Page Speed Optimization Libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
net_instaweb::Arena< T > Class Template Reference

#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

Detailed Description

template<typename T>
class net_instaweb::Arena< T >

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.

Member Function Documentation

template<typename T>
void* net_instaweb::Arena< T >::Allocate ( size_t  size)

< 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.

template<typename T >
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.

Member Data Documentation

template<typename T>
const size_t net_instaweb::Arena< T >::kAlign = 8

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.

The documentation for this class was generated from the following file: