Unsafe operations

Function bump_box_refcount

unsafe fn bump_box_refcount<T>(+t: @T)

Force-increment the reference count on a shared box. If used uncarefully, this can leak the box. Use this in conjunction with transmute and/or reinterpret_cast when such calls would otherwise scramble a box's reference count

Function forget

unsafe fn forget<T>(-thing: T)

Move a thing into the void

The forget function will take ownership of the provided value but neglect to run any required cleanup or memory-management operations on it. This can be used for various acts of magick, particularly when using reinterpret_cast on managed pointer types.

Function reinterpret_cast

unsafe fn reinterpret_cast<T, U>(src: T) -> U

Casts the value at src to U. The two types must have the same length.

Function transmute

unsafe fn transmute<L, G>(-thing: L) -> G

Transform a value of one type into a value of another type. Both types must have the same size and alignment.

Example

assert transmute("L") == [76u8, 0u8]/~;