Memory utility library
Types
-
Represents one object that supports manual construction and destruction.
-
Describes one member used by memory layouting algorithms.
Functions
-
void * memzero(void *dst, usize byte_count)
Clears the specified memory region to 0.
-
Clears the memory of the specified object to 0.
-
Copies the data for a 2D bitmap.
-
Copies the data for a 3D bitmap.
-
Returns a pointer that offsets the specified pixels in the bitmap.
-
Returns a pointer that offsets the specified pixels in the bitmap.
-
constexpr unsigned long long operator""_kb(unsigned long long v)
A integer literal suffix that multiples one number with 1024. Use it like
3_kb
. -
constexpr unsigned long long operator""_mb(unsigned long long v)
A integer literal suffix that multiples one number with 1024 * 1024. Use it like
3_mb
. -
constexpr unsigned long long operator""_gb(unsigned long long v)
A integer literal suffix that multiples one number with 1024 * 1024 * 1024. Use it like
3_gb
. -
constexpr unsigned long long operator""_tb(unsigned long long v)
A integer literal suffix that multiples one number with 1024 * 1024 * 1024 * 1024. Use it like
3_tb
. -
bool bit_test(const void *base_addr, usize bit_offset)
Tests if specified bit is 1.
-
void bit_set(void *addr, usize bit_offset)
Sets the specified bit to 1.
-
void bit_reset(void *addr, usize bit_offset)
Sets the specified bit to 0.
-
void bit_set(void *addr, usize bit_offset, bool value)
Sets the specified bit to 1 if
value
istrue
, or to 0 ifvalue
isfalse
. -
constexpr _Ty1 align_upper(_Ty1 origin, _Ty2 alignment)
Returns the address/size that aligns the origin address/size to the nearest matched aligned address/size that is greater than or equal to the the origin address/size.
-
Gets the real address for object or function
value
, even if theoperator&
of the object has been overloaded. -
void default_construct(_Iter dst)
Calls the default constructor for the object.
-
void value_construct(_Iter dst)
Calls the value constructor for the object.
-
void copy_construct(_Iter1 dst, _Iter2 src)
Calls the copy constructor for the object.
-
void move_construct(_Iter1 dst, _Iter2 src)
Calls the move constructor for the object.
-
void direct_construct(_Iter dst, _Args &&... args)
Calls the direct constructor for the object.
-
Calls the destructor of the object.
-
void copy_assign(_Iter1 dst, _Iter2 src)
Calls the copy assignment operator of the object.
-
void move_assign(_Iter1 dst, _Iter2 src)
Calls the move assignment operator of the object.
-
Default-constructs a range of objects.
-
Value-constructs a range of objects.
-
Copy-constructs a range of objects.
-
Copy-constructs a range of objects. The range is provided by first object and object count.
-
Move-constructs a range of objects.
-
Destructs every object in the range.
-
Performs copy assignment operation on every object in the destination range using the corresponding object in the source range.
-
Performs move assignment operation on every object in the destination range using the corresponding object in the source range.
-
Same as move_assign_range, but performs the move assign from back to front.
-
_Iter1 fill_construct_range(_Iter1 first, _Iter1 last, const _Ty &value)
Performs copy construct on each of the object in the range by taking a copy of the provided object.
-
_Iter1 fill_assign_range(_Iter1 first, _Iter1 last, const _Ty &value)
Performs copy assignment on each of the object in the range by taking a copy of the provided object.
-
Relocates objects in the source range to a new range that is not overlap with the source range.
-
Relocates one object.
-
Relocates objects in the source range to a new range.
-
Relocates objects in the source range to a new range.
-
Calculates the size, alignment and memory layout for one structure type.
-
Calculates the size, alignment and memory layout for one union type.