Page Speed Optimization Libraries
1.13.35.1
|
#include "arena.h"
Public Member Functions | |
void * | Allocate (size_t size) |
void | DestroyObjects () |
Cleans up all the objects in the arena. You must call this explicitly. More... | |
Static Public Member Functions | |
static size_t | ExpandToAlign (size_t in) |
Rounds block size up to 8; we always align to it, even on 32-bit. | |
Static Public Attributes | |
static const size_t | kAlign = 8 |
This template keeps a packed set of objects inheriting from the same base type (which must have a virtual destructor) where all of the objects in the same arena are expected to be destroyed at once.
|
inline |
< Need room to link the next object.
Update the links – the previous object should point to our chunk's base, our base should point to NULL, and last_link_ should point to our base
Warning: the following line is very type-sensitive and can't easily be turned into a DCHECK_EQ as lint would like.
void net_instaweb::Arena< T >::DestroyObjects | ( | ) |
Cleans up all the objects in the arena. You must call this explicitly.
Walk through objects in this chunk.
|
static |
All allocations we make will be aligned to this. We will also reserve this much room for our work area, as it keeps things simple.