about summary refs log tree commit diff
path: root/src/libstd/thread
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-08-06 15:01:35 +0000
committerbors <bors@rust-lang.org>2015-08-06 15:01:35 +0000
commit83f2667fa200a1bfa420af878fe81fc77ea19139 (patch)
tree5d35fed4d4887faec83dfc9353bb1bfc039b8620 /src/libstd/thread
parent8f3901feabf6c9072e533ae69b14b5761909f642 (diff)
parent9bfb8d3addc8eed916b3ff0747131c1f9bb97e52 (diff)
downloadrust-83f2667fa200a1bfa420af878fe81fc77ea19139.tar.gz
rust-83f2667fa200a1bfa420af878fe81fc77ea19139.zip
Auto merge of #27434 - jeehoonkang:master, r=Gankro
In Section 3.2, TARPL says that "standard allocators (including jemalloc, the one used by default in Rust) generally consider passing in 0 for the size of an allocation as Undefined Behaviour."
However, the C standard and jemalloc manual says allocating zero bytes
should succeed:

- C11 7.22.3 paragraph 1: "If the size of the space requested is zero, the behavior is implementation-defined: either a null pointer is returned, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not be used to access an object."
- [jemalloc manual](http://www.freebsd.org/cgi/man.cgi?query=jemalloc&sektion=3): "The malloc and calloc functions return a	pointer	to the allocated memory if successful; otherwise a NULL pointer is returned and errno is set to ENOMEM."
    + Note that the description for `allocm` says "Behavior	is undefined if	size is 0," but it is an experimental API.

r? @Gankro 
Diffstat (limited to 'src/libstd/thread')
0 files changed, 0 insertions, 0 deletions