fix silent truncation of requested memory amount in 32-bit builds
This commit is contained in:
parent
d640931c02
commit
72e46f24bd
@ -68,6 +68,7 @@ static NOINLINE void* BN(allocateMore)(ux bucket, u8 type, ux from, ux to) {
|
||||
u8* mem = calloc(reqsz, 1);
|
||||
if (mem_log_enabled) fprintf(stderr, "\n");
|
||||
#else
|
||||
if (reqsz != (size_t) reqsz) thrOOM(); // otherwise it gets silently truncated in 32-bit builds
|
||||
u8* mem = MMAP(reqsz);
|
||||
if (mem_log_enabled) fprintf(stderr, ": %s\n", mem==MAP_FAILED? "failed" : "success");
|
||||
if (mem==MAP_FAILED) thrOOM();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user