mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-01 03:23:09 +03:00
make asserting malloc into a #define
This commit is contained in:
parent
9733f6ce66
commit
75dce9eefc
@ -90,5 +90,9 @@
|
||||
} while (0)
|
||||
/* c3_malloc(): asserting malloc
|
||||
*/
|
||||
void*
|
||||
c3_malloc(size_t s);
|
||||
#define c3_malloc(s) ({ \
|
||||
void* rut = malloc(s); \
|
||||
if ( 0 == rut ) { \
|
||||
c3_assert(!"memory lost"); \
|
||||
} \
|
||||
rut;})
|
||||
|
10
v/main.c
10
v/main.c
@ -256,16 +256,6 @@ static void _main_cont(void *arg1, void *arg2, void *arg3)
|
||||
siglongjmp(Signal_buf, 1);
|
||||
}
|
||||
|
||||
void*
|
||||
c3_malloc(size_t s)
|
||||
{
|
||||
void* rut = malloc(s);
|
||||
if ( u2_nul == rut ) {
|
||||
c3_assert(!"memory lost");
|
||||
}
|
||||
return rut;
|
||||
}
|
||||
|
||||
static void
|
||||
overflow_handler(int emergency, stackoverflow_context_t scp)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user