rcthomas / resist

BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

The memory allocator should assert that the allocation succeeded. #31

Closed bcfriesen closed 7 years ago

bcfriesen commented 7 years ago

Currently we have

...
ptr = (type*) resist_malloc(size);
assert(ptr);
...

which leads to lots of asserts pasted all over the code base. We can make this more succinct by putting the assert in the allocator itself.

bcfriesen commented 7 years ago

Actually, there already is an assert in the allocator (see line 32 of resist-memory.c). I will remove the redundant asserts in resist-context.c then.