mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1004816 (part 2) - Remove FreeList::infallibleAllocate(). r=billm.
--HG-- extra : rebase_source : f1a2529fcb1afc10a02679ac5074ca99b8ebe691
This commit is contained in:
parent
b00c8d6bde
commit
d11156fc7d
@ -380,23 +380,6 @@ class FreeList
|
||||
return reinterpret_cast<void *>(thing);
|
||||
}
|
||||
|
||||
/* A version of allocate when we know that the span is not empty. */
|
||||
MOZ_ALWAYS_INLINE void *infallibleAllocate(size_t thingSize) {
|
||||
JS_ASSERT(!isEmpty());
|
||||
JS_ASSERT(thingSize % CellSize == 0);
|
||||
head.checkSpan(thingSize);
|
||||
uintptr_t thing = head.first;
|
||||
if (thing < head.last) {
|
||||
head.first = thing + thingSize;
|
||||
} else {
|
||||
JS_ASSERT(thing);
|
||||
setHead(reinterpret_cast<FreeSpan *>(thing));
|
||||
}
|
||||
head.checkSpan(thingSize);
|
||||
JS_EXTRA_POISON(reinterpret_cast<void *>(thing), JS_ALLOCATED_TENURED_PATTERN, thingSize);
|
||||
return reinterpret_cast<void *>(thing);
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate from a newly allocated arena. The arena will have been set up
|
||||
* as fully used during the initialization so to allocate we simply return
|
||||
|
@ -1537,7 +1537,9 @@ ArenaLists::allocateFromArenaInline(Zone *zone, AllocKind thingKind)
|
||||
PushArenaAllocatedDuringSweep(zone->runtimeFromMainThread(), aheader);
|
||||
}
|
||||
}
|
||||
return freeLists[thingKind].infallibleAllocate(Arena::thingSize(thingKind));
|
||||
void *thing = freeLists[thingKind].allocate(Arena::thingSize(thingKind));
|
||||
JS_ASSERT(thing); // This allocation is infallible.
|
||||
return thing;
|
||||
}
|
||||
|
||||
/* Make sure we hold the GC lock before we call PickChunk. */
|
||||
|
Loading…
Reference in New Issue
Block a user