Merge "Add missing MALLOC_FAILURE_ACTION calls to dlmalloc."

This commit is contained in:
Elliott Hughes 2012-09-04 15:51:55 -07:00 committed by android code review
commit e03ab93699

View file

@ -4049,12 +4049,20 @@ static void* sys_alloc(mstate m, size_t nb) {
} }
asize = granularity_align(nb + SYS_ALLOC_PADDING); 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 */ return 0; /* wraparound */
}
if (m->footprint_limit != 0) { if (m->footprint_limit != 0) {
size_t fp = m->footprint + asize; 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; return 0;
}
} }
/* /*