Broom 1.0.0
A thread-local C++ Garbage Collector
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
broom::Allocator Class Referenceabstract

#include <allocator.h>

Inheritance diagram for broom::Allocator:
Inheritance graph
[legend]
Collaboration diagram for broom::Allocator:
Collaboration graph
[legend]

Classes

struct  AllocatorStatistics
 

Public Member Functions

virtual ~Allocator ()=default
 
virtual bool Grow (size_t requested_size, MemorySpace **space_to_update)=0
 
virtual size_t LargeSpaceThreshold () const =0
 
virtual voidAllocate (size_t requested_size)=0
 
virtual void Dispose (void *definitely_uintptr)=0
 
virtual const voidGetBasePointerOfMaybeInnerPointer (const void *maybe_inner) const =0
 
MemoryPressure CalculateMemoryPressure () const
 

Static Public Attributes

static constexpr const int kFrontMetadataSize
 
static constexpr const int kBackMetadataSize = sizeof(AllocatorBackMetadata)
 
static constexpr const int kTotalMetadataSize
 
static constexpr const size_t kDefaultSpaceSize = 2 * MB
 
static constexpr const size_t kDefaultLargeSpaceSize = 64 * MB
 
static constexpr const size_t kDefaultLargeSpaceThreshold = 1 * MB
 
static constexpr const MemoryPermissions kDefaultPermissions
 
static constexpr const size_t kGiantMappingSize = kDefaultLargeSpaceSize
 

Protected Member Functions

 Allocator ()=default
 

Static Protected Member Functions

static void PinBasePointer (const void *pointer, uint32_t how_many)
 
static void UnpinBasePointer (const void *pointer)
 
static bool IsPinnedBasePointer (const void *pointer)
 
static size_t SpaceMask (size_t space_size)
 

Protected Attributes

AllocatorStatistics stats_
 

Friends

class GarbageCollector
 

Detailed Description

Definition at line 235 of file allocator.h.

Constructor & Destructor Documentation

◆ ~Allocator()

virtual broom::Allocator::~Allocator ( )
virtualdefault

◆ Allocator()

broom::Allocator::Allocator ( )
protecteddefault

Member Function Documentation

◆ Allocate()

virtual void * broom::Allocator::Allocate ( size_t  requested_size)
pure virtual

Implemented in broom::FreeListAllocator.

◆ CalculateMemoryPressure()

MemoryPressure broom::Allocator::CalculateMemoryPressure ( ) const
inline

Definition at line 261 of file allocator.h.

◆ Dispose()

virtual void broom::Allocator::Dispose ( void definitely_uintptr)
pure virtual

Implemented in broom::FreeListAllocator.

◆ GetBasePointerOfMaybeInnerPointer()

virtual const void * broom::Allocator::GetBasePointerOfMaybeInnerPointer ( const void maybe_inner) const
pure virtual

Implemented in broom::FreeListAllocator.

◆ Grow()

virtual bool broom::Allocator::Grow ( size_t  requested_size,
MemorySpace **  space_to_update 
)
pure virtual

Implemented in broom::FreeListAllocator.

◆ IsPinnedBasePointer()

static bool broom::Allocator::IsPinnedBasePointer ( const void pointer)
inlinestaticprotected

Definition at line 291 of file allocator.h.

◆ LargeSpaceThreshold()

virtual size_t broom::Allocator::LargeSpaceThreshold ( ) const
pure virtual

Implemented in broom::FreeListAllocator.

◆ PinBasePointer()

static void broom::Allocator::PinBasePointer ( const void pointer,
uint32_t  how_many 
)
inlinestaticprotected

Definition at line 281 of file allocator.h.

◆ SpaceMask()

static size_t broom::Allocator::SpaceMask ( size_t  space_size)
inlinestaticprotected

Definition at line 296 of file allocator.h.

◆ UnpinBasePointer()

static void broom::Allocator::UnpinBasePointer ( const void pointer)
inlinestaticprotected

Definition at line 286 of file allocator.h.

Friends And Related Symbol Documentation

◆ GarbageCollector

Definition at line 303 of file allocator.h.

Member Data Documentation

◆ kBackMetadataSize

constexpr const int broom::Allocator::kBackMetadataSize = sizeof(AllocatorBackMetadata)
staticconstexpr

Definition at line 240 of file allocator.h.

◆ kDefaultLargeSpaceSize

constexpr const size_t broom::Allocator::kDefaultLargeSpaceSize = 64 * MB
staticconstexpr

Definition at line 245 of file allocator.h.

◆ kDefaultLargeSpaceThreshold

constexpr const size_t broom::Allocator::kDefaultLargeSpaceThreshold = 1 * MB
staticconstexpr

Definition at line 246 of file allocator.h.

◆ kDefaultPermissions

constexpr const MemoryPermissions broom::Allocator::kDefaultPermissions
staticconstexpr
Initial value:

Definition at line 247 of file allocator.h.

◆ kDefaultSpaceSize

constexpr const size_t broom::Allocator::kDefaultSpaceSize = 2 * MB
staticconstexpr

Definition at line 244 of file allocator.h.

◆ kFrontMetadataSize

constexpr const int broom::Allocator::kFrontMetadataSize
staticconstexpr
Initial value:
=
sizeof(AllocatorFrontMetadata)

Definition at line 238 of file allocator.h.

◆ kGiantMappingSize

constexpr const size_t broom::Allocator::kGiantMappingSize = kDefaultLargeSpaceSize
staticconstexpr

Definition at line 249 of file allocator.h.

◆ kTotalMetadataSize

constexpr const int broom::Allocator::kTotalMetadataSize
staticconstexpr
Initial value:
=
static constexpr const int kFrontMetadataSize
Definition allocator.h:238
static constexpr const int kBackMetadataSize
Definition allocator.h:240

Definition at line 241 of file allocator.h.

◆ stats_

AllocatorStatistics broom::Allocator::stats_
protected

Definition at line 302 of file allocator.h.


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