mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 699395 - Modify zone_good_size to call je_malloc_usable_size_in_advance. r=njn
--HG-- extra : rebase_source : 24feb93e8ceebd74a8dbcb0084f7f27ecf6495e3
This commit is contained in:
parent
f4dc7146c2
commit
5dec9d83e1
@ -6878,24 +6878,7 @@ zone_destroy(malloc_zone_t *zone)
|
||||
static size_t
|
||||
zone_good_size(malloc_zone_t *zone, size_t size)
|
||||
{
|
||||
size_t ret;
|
||||
void *p;
|
||||
|
||||
/*
|
||||
* Actually create an object of the appropriate size, then find out
|
||||
* how large it could have been without moving up to the next size
|
||||
* class.
|
||||
*
|
||||
* I sure hope this doesn't get called often.
|
||||
*/
|
||||
p = malloc(size);
|
||||
if (p != NULL) {
|
||||
ret = isalloc(p);
|
||||
free(p);
|
||||
} else
|
||||
ret = size;
|
||||
|
||||
return (ret);
|
||||
return je_malloc_usable_size_in_advance(size);
|
||||
}
|
||||
|
||||
static size_t
|
||||
|
Loading…
x
Reference in New Issue
Block a user