Use assert in wapp_mem_util_align_forward instead of returning NULL
This commit is contained in:
@@ -7,11 +7,8 @@
|
||||
internal bool is_power_of_two(u64 num) { return (num & (num - 1)) == 0; }
|
||||
|
||||
void *wapp_mem_util_align_forward(void *ptr, u64 alignment) {
|
||||
if (!ptr) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
assert(is_power_of_two(alignment));
|
||||
assert(ptr != NULL && "ptr argument shouldn't be NULL");
|
||||
assert(is_power_of_two(alignment) && "Alignment isn't a power of 2");
|
||||
|
||||
uptr p = (uptr)ptr;
|
||||
uptr align = (uptr)alignment;
|
||||
|
||||
Reference in New Issue
Block a user