November 2017
Intermediate to advanced
264 pages
5h 45m
English
In unsafe code blocks, Rust allows the use of a new kind of pointers called raw pointers. These pointers have no built-in security, but you can work with them with the same freedom as you would with C pointers. They are written as:
These can point to invalid memory, and the memory resources need to be manually freed. This means that a raw pointer could inadvertently be used after freeing the memory it points to. Also, multiple concurrent threads have non-exclusive access to mutable raw pointers. Because you're not sure of its contents (at least, we have no compiler guarantee of valid content), dereferencing a raw pointer can also lead to program ...
Read now
Unlock full access