do reqsz != (size_t) reqsz check in NO_MMAP builds too
This commit is contained in:
parent
68a969b417
commit
09642a354f
@ -64,11 +64,11 @@ static NOINLINE void* BN(allocateMore)(ux bucket, u8 type, ux from, ux to) {
|
|||||||
#if ALLOC_MODE==0
|
#if ALLOC_MODE==0
|
||||||
reqsz = prepAllocSize(reqsz);
|
reqsz = prepAllocSize(reqsz);
|
||||||
#endif
|
#endif
|
||||||
|
if (reqsz != (size_t) reqsz) thrOOM(); // otherwise it gets silently truncated in 32-bit builds
|
||||||
#if NO_MMAP
|
#if NO_MMAP
|
||||||
u8* mem = calloc(reqsz, 1);
|
u8* mem = calloc(reqsz, 1);
|
||||||
if (mem_log_enabled) fprintf(stderr, "\n");
|
if (mem_log_enabled) fprintf(stderr, "\n");
|
||||||
#else
|
#else
|
||||||
if (reqsz != (size_t) reqsz) thrOOM(); // otherwise it gets silently truncated in 32-bit builds
|
|
||||||
u8* mem = MMAP(reqsz);
|
u8* mem = MMAP(reqsz);
|
||||||
if (mem_log_enabled) fprintf(stderr, ": %s\n", mem==MAP_FAILED? "failed" : "success");
|
if (mem_log_enabled) fprintf(stderr, ": %s\n", mem==MAP_FAILED? "failed" : "success");
|
||||||
if (mem==MAP_FAILED) thrOOM();
|
if (mem==MAP_FAILED) thrOOM();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user