Bug 414087 (part 2) - Remove insignificant wasted space in StackBlock. r=bz.

This commit is contained in:
Nicholas Nethercote 2013-09-25 21:28:55 -07:00
Родитель 929154dfe5
Коммит 228510e1ec
2 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -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);
}