<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/liballoc_system, branch 1.26.2</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.26.2</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.26.2'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2018-04-02T07:06:19+00:00</updated>
<entry>
<title>Use Alloc and Layout from core::heap.</title>
<updated>2018-04-02T07:06:19+00:00</updated>
<author>
<name>Mike Hommey</name>
<email>mh@glandium.org</email>
</author>
<published>2018-04-02T07:05:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b647583c2df155f4741fa2b3e1fa6e4fb1f5868f'/>
<id>urn:sha1:b647583c2df155f4741fa2b3e1fa6e4fb1f5868f</id>
<content type='text'>
94d1970bba87f2d2893f6e934e4c3f02ed50604d moved the alloc::allocator
module to core::heap, moving e.g. Alloc and Layout out of the alloc
crate. While alloc::heap reexports them, it's better to use them from
where they really come from.
</content>
</entry>
<entry>
<title>Build the right platform module on CloudABI.</title>
<updated>2017-12-31T12:21:46+00:00</updated>
<author>
<name>Ed Schouten</name>
<email>ed@nuxi.nl</email>
</author>
<published>2017-12-31T12:21:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c661e385fd81afef808f414867cc44a6c897195e'/>
<id>urn:sha1:c661e385fd81afef808f414867cc44a6c897195e</id>
<content type='text'>
After #47089 lands, CloudABI will no longer be considered UNIX. We need
to pick the right allocator flavour now.
</content>
</entry>
<entry>
<title>Disable printing of error message on file descriptor 2 on CloudABI.</title>
<updated>2017-12-27T17:38:57+00:00</updated>
<author>
<name>Ed Schouten</name>
<email>ed@nuxi.nl</email>
</author>
<published>2017-12-27T17:38:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=838fb4a6a0d11ac2c24189518415d181638af001'/>
<id>urn:sha1:838fb4a6a0d11ac2c24189518415d181638af001</id>
<content type='text'>
As CloudABI is a capability-based runtime environment, file descriptors
are the mechanism that grants rights to a process. These file
descriptors may be passed into processes on startup using a utility
called cloudabi-run. Unlike the POSIX shell, cloudabi-run does not
follow the UNIX model where file descriptors 0, 1 and 2 represent stdin,
stdout and stderr. There can be arbitrary many (or few) file descriptors
that can be provided. For this reason, CloudABI's C library also doesn't
define STD*_FILENO. liblibc should also not declare these.

Disable the code in liballoc_system that tries to print error messages
over file descriptor 2. For now, let's keep this function quiet. We'll
see if we can think of some other way to log this in the future.
</content>
</entry>
<entry>
<title>Remove comment about a branch being optimized out, fix #45831</title>
<updated>2017-11-20T15:22:17+00:00</updated>
<author>
<name>Simon Sapin</name>
<email>simon.sapin@exyr.org</email>
</author>
<published>2017-11-20T14:55:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=43e32b53462e139c560672102724e8a8c859dbf7'/>
<id>urn:sha1:43e32b53462e139c560672102724e8a8c859dbf7</id>
<content type='text'>
Most often, this code is used through the `std::heap::Heap`
and `#[gloabal_allocator]` indirection, so this branch is not
optimized out anymore.
</content>
</entry>
<entry>
<title>alloc_system: don’t assume MIN_ALIGN for small sizes, fix #45955</title>
<updated>2017-11-20T14:56:53+00:00</updated>
<author>
<name>Simon Sapin</name>
<email>simon.sapin@exyr.org</email>
</author>
<published>2017-11-20T14:30:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=21d899272a7fb39a497424e3260ddab773af7983'/>
<id>urn:sha1:21d899272a7fb39a497424e3260ddab773af7983</id>
<content type='text'>
The GNU C library (glibc) is documented to always allocate with an alignment
of at least 8 or 16 bytes, on 32-bit or 64-bit platforms:
https://www.gnu.org/software/libc/manual/html_node/Aligned-Memory-Blocks.html

This matches our use of `MIN_ALIGN` before this commit.
However, even when libc is glibc, the program might be linked
with another allocator that redefines the `malloc` symbol and friends.
(The `alloc_jemalloc` crate does, in some cases.)

So `alloc_system` doesn’t know which allocator it calls,
and needs to be conservative in assumptions it makes.

The C standard says:

https://port70.net/%7Ensz/c/c11/n1570.html#7.22.3
&gt; The pointer returned if the allocation succeeds is suitably aligned
&gt; so that it may be assigned to a pointer to any type of object
&gt; with a fundamental alignment requirement

https://port70.net/~nsz/c/c11/n1570.html#6.2.8p2
&gt; A fundamental alignment is represented by an alignment less than
&gt; or equal to the greatest alignment supported by the implementation
&gt; in all contexts, which is equal to `_Alignof (max_align_t)`.

`_Alignof (max_align_t)` depends on the ABI and doesn’t seem to have
a clear definition, but it seems to match our `MIN_ALIGN` in practice.

However, the size of objects is rounded up to the next multiple
of their alignment (since that size is also the stride used in arrays).
Conversely, the alignment of a non-zero-size object is at most its size.
So for example it seems ot be legal for `malloc(8)` to return a pointer
that’s only 8-bytes-aligned, even if `_Alignof (max_align_t)` is 16.
</content>
</entry>
<entry>
<title>std: Add a new wasm32-unknown-unknown target</title>
<updated>2017-11-20T05:07:41+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2017-10-23T03:01:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=80ff0f74b0c4a8d384160af81a1b21f53622d8af'/>
<id>urn:sha1:80ff0f74b0c4a8d384160af81a1b21f53622d8af</id>
<content type='text'>
This commit adds a new target to the compiler: wasm32-unknown-unknown. This
target is a reimagining of what it looks like to generate WebAssembly code from
Rust. Instead of using Emscripten which can bring with it a weighty runtime this
instead is a target which uses only the LLVM backend for WebAssembly and a
"custom linker" for now which will hopefully one day be direct calls to lld.

Notable features of this target include:

* There is zero runtime footprint. The target assumes nothing exists other than
  the wasm32 instruction set.
* There is zero toolchain footprint beyond adding the target. No custom linker
  is needed, rustc contains everything.
* Very small wasm modules can be generated directly from Rust code using this
  target.
* Most of the standard library is stubbed out to return an error, but anything
  related to allocation works (aka `HashMap`, `Vec`, etc).
* Naturally, any `#[no_std]` crate should be 100% compatible with this new
  target.

This target is currently somewhat janky due to how linking works. The "linking"
is currently unconditional whole program LTO (aka LLVM is being used as a
linker). Naturally that means compiling programs is pretty slow! Eventually
though this target should have a linker.

This target is also intended to be quite experimental. I'm hoping that this can
act as a catalyst for further experimentation in Rust with WebAssembly. Breaking
changes are very likely to land to this target, so it's not recommended to rely
on it in any critical capacity yet. We'll let you know when it's "production
ready".

---

Currently testing-wise this target is looking pretty good but isn't complete.
I've got almost the entire `run-pass` test suite working with this target (lots
of tests ignored, but many passing as well). The `core` test suite is still
getting LLVM bugs fixed to get that working and will take some time. Relatively
simple programs all seem to work though!

---

It's worth nothing that you may not immediately see the "smallest possible wasm
module" for the input you feed to rustc. For various reasons it's very difficult
to get rid of the final "bloat" in vanilla rustc (again, a real linker should
fix all this). For now what you'll have to do is:

    cargo install --git https://github.com/alexcrichton/wasm-gc
    wasm-gc foo.wasm bar.wasm

And then `bar.wasm` should be the smallest we can get it!

---

In any case for now I'd love feedback on this, particularly on the various
integration points if you've got better ideas of how to approach them!
</content>
</entry>
<entry>
<title>Fix out of date unstable book entries for `alloc_*` features.</title>
<updated>2017-10-12T05:46:02+00:00</updated>
<author>
<name>Simon Sapin</name>
<email>simon.sapin@exyr.org</email>
</author>
<published>2017-10-11T19:25:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=818d2249475910fa1f7844486abb2d7239056d96'/>
<id>urn:sha1:818d2249475910fa1f7844486abb2d7239056d96</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Autodetect the type of allocator crate used</title>
<updated>2017-09-10T17:59:42+00:00</updated>
<author>
<name>Michal 'vorner' Vaner</name>
<email>vorner@vorner.cz</email>
</author>
<published>2017-09-10T17:59:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=94297c67465c3bd124063de717f7574491f5cc7d'/>
<id>urn:sha1:94297c67465c3bd124063de717f7574491f5cc7d</id>
<content type='text'>
Annotate the allocator crates (allocator_system, allocator_jemalloc) by
the type of allocator they are. If one is requested as an exe allocator,
detect its type by the flags.

This has the effect that using this (de jure wrong) configuration in the
target spec works instead of producing a really unhelpful and arcane
linker error:

"exe-allocation-crate": "alloc_system"

Fixes #43524.
</content>
</entry>
<entry>
<title>Use memalign instead of posix_memalign for Solaris</title>
<updated>2017-09-06T19:31:19+00:00</updated>
<author>
<name>bgermann</name>
<email>bgermann@users.noreply.github.com</email>
</author>
<published>2017-09-06T19:31:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5b76b8681c088d935b60da05e8ae81e2594f46f5'/>
<id>urn:sha1:5b76b8681c088d935b60da05e8ae81e2594f46f5</id>
<content type='text'>
As pointed out in https://github.com/rust-lang/libc/commit/deb61c8,
Solaris 10 does not support posix_memalign.
Use memalign for all Solaris versions instead.
With this change applied I am able to cross-build rustc for Solaris 10.
</content>
</entry>
<entry>
<title>*: remove crate_{name,type} attributes</title>
<updated>2017-08-25T20:18:21+00:00</updated>
<author>
<name>Tamir Duberstein</name>
<email>tamird@gmail.com</email>
</author>
<published>2017-08-19T23:54:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b3f50caee0e2f2f4d44e1c83bf73a112c2a398b1'/>
<id>urn:sha1:b3f50caee0e2f2f4d44e1c83bf73a112c2a398b1</id>
<content type='text'>
Fixes #41701.
</content>
</entry>
</feed>
