am e03ab936
: Merge "Add missing MALLOC_FAILURE_ACTION calls to dlmalloc."
* commit 'e03ab936996a1a46d461cdad463d7f5bca10b051': Add missing MALLOC_FAILURE_ACTION calls to dlmalloc.
This commit is contained in:
commit
507bcabb35
1 changed files with 10 additions and 2 deletions
|
@ -4049,13 +4049,21 @@ static void* sys_alloc(mstate m, size_t nb) {
|
|||
}
|
||||
|
||||
asize = granularity_align(nb + SYS_ALLOC_PADDING);
|
||||
if (asize <= nb)
|
||||
if (asize <= nb) {
|
||||
/* BEGIN android-added: set errno */
|
||||
MALLOC_FAILURE_ACTION;
|
||||
/* END android-added */
|
||||
return 0; /* wraparound */
|
||||
}
|
||||
if (m->footprint_limit != 0) {
|
||||
size_t fp = m->footprint + asize;
|
||||
if (fp <= m->footprint || fp > m->footprint_limit)
|
||||
if (fp <= m->footprint || fp > m->footprint_limit) {
|
||||
/* BEGIN android-added: set errno */
|
||||
MALLOC_FAILURE_ACTION;
|
||||
/* END android-added */
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Try getting memory in any of three ways (in most-preferred to
|
||||
|
|
Loading…
Reference in a new issue