зеркало из https://github.com/mozilla/gecko-dev.git
Bug 414087 (part 2) - Remove insignificant wasted space in StackBlock. r=bz.
This commit is contained in:
Родитель
929154dfe5
Коммит
228510e1ec
|
@ -10,11 +10,10 @@ namespace mozilla {
|
|||
|
||||
// A block of memory that the stack will chop up and hand out.
|
||||
struct StackBlock {
|
||||
// A bit under 4096, for malloc overhead.
|
||||
static const size_t MAX_USABLE_SIZE = 4044;
|
||||
// Subtract sizeof(StackBlock*) to give space for the |mNext| field.
|
||||
static const size_t MAX_USABLE_SIZE = 4096 - sizeof(StackBlock*);
|
||||
|
||||
// A block of memory. Note that this must be first so that it will
|
||||
// be aligned.
|
||||
// A block of memory.
|
||||
char mBlock[MAX_USABLE_SIZE];
|
||||
|
||||
// Another block of memory that would only be created if our stack
|
||||
|
@ -25,6 +24,8 @@ struct StackBlock {
|
|||
~StackBlock() { }
|
||||
};
|
||||
|
||||
static_assert(sizeof(StackBlock) == 4096, "StackBlock must be 4096 bytes");
|
||||
|
||||
// We hold an array of marks. A push pushes a mark on the stack.
|
||||
// A pop pops it off.
|
||||
struct StackMark {
|
||||
|
|
|
@ -82,7 +82,6 @@ public:
|
|||
}
|
||||
|
||||
static void* Allocate(size_t aSize) {
|
||||
MOZ_ASSERT(aSize <= 4044);
|
||||
return gStackArena->Allocate(aSize);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче