explicitly talk about integer literals
This commit is contained in:
parent
c555aabc5b
commit
0f572a9810
2 changed files with 7 additions and 7 deletions
|
@ -21,10 +21,10 @@
|
|||
//! within the bounds of a single allocated object. Note that in Rust,
|
||||
//! every (stack-allocated) variable is considered a separate allocated object.
|
||||
//! * Even for operations of [size zero][zst], the pointer must not be "dangling" in the sense of
|
||||
//! pointing to deallocated memory. However, casting any non-zero integer to a pointer is valid
|
||||
//! for zero-sized accesses. This corresponds to writing your own allocator; allocating zero-sized
|
||||
//! objects is not very hard. In contrast, when you use the standard allocator, after memory got
|
||||
//! deallocated, even zero-sized accesses to that memory are invalid.
|
||||
//! pointing to deallocated memory. However, casting any non-zero integer literal to a pointer is
|
||||
//! valid for zero-sized accesses. This corresponds to writing your own allocator; allocating
|
||||
//! zero-sized objects is not very hard. In contrast, when you use the standard allocator, after
|
||||
//! memory got deallocated, even zero-sized accesses to that memory are invalid.
|
||||
//! * All accesses performed by functions in this module are *non-atomic* in the sense
|
||||
//! of [atomic operations] used to synchronize between threads. This means it is
|
||||
//! undefined behavior to perform two concurrent accesses to the same location from different
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue