DescriptionPartitionAlloc: Leave bucket in valid state when allocation fails
When an allocation with the PartitionAllocReturnNull flag fails, we need to
make sure to leave all structures in a valid state when bailing out, since
the process lives on and may call again later.
Specifically, make sure that the bucket's activePagesHead has a valid value,
instead of null, when returning null from partitionAllocSlowPath(). Since
there's no meaningful page to set as the active pages head, set it to its
initial value, &PartitionRootBase::gSeedPage.
This was already necessarily supported by the allocation code paths. The
deallocation code path needs some minor adjustments to handle this state
correctly.
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=184983
Patch Set 1 #Patch Set 2 : fixed leak #Patch Set 3 : add fix #
Total comments: 1
Patch Set 4 : use setrlimit() in test if OS(POSIX) #Patch Set 5 : make test more robust #Patch Set 6 : check that an allocation failed #Patch Set 7 : rebased #
Total comments: 15
Patch Set 8 : address nits #Patch Set 9 : avoid integer overflow on 32-bit systems #
Total comments: 1
Messages
Total messages: 20 (4 generated)
|