Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

lib.res.file
Class CacheAllocator

   in file_cache.cpp

class CacheAllocator


Inner Classes, Typedefs, and Enums
struct CacheAllocator::Footer
          
struct CacheAllocator::Header
          
 
Field Summary
private cassert( BUF_ALIGN >
          
private AllocatorChecker alloc_checker
          
private size_t allocated_size_total_pa
          
private uintptr_t bitmap
          
private static const u32 FOOTER_ID
          
private size_t free_size_total_pa
          
private CacheAllocator::Header[ sizeof ( uintptr_t ) * CHAR_BIT ] freelists
          
private static const u32 HEADER_ID
          
private static const u32 MAGIC
          
private Pool pool
          
 
Constructor Summary
CacheAllocator()
          
 
Method Summary
 void* alloc( size_t size )
          
private void* alloc_from_class( uint size_class, size_t size_pa )
          
private void* alloc_from_larger_class( uint start_size_class, size_t size_pa )
          
private void coalesce_and_free( u8* p, size_t size_pa )
          
 void dealloc( u8* p, size_t size )
          
private void freelist_add( u8* p, size_t size_pa )
          
private void freelist_remove( CacheAllocator::Header* header )
          
private bool is_valid_tag( u32 expected_id, u32 id, u32 magic, size_t size_pa ) const
          
private static uint ls1( uint x )
          
 void make_read_only( u8* p, size_t size )
          
 void reset()
          
private void self_check() const
          
 void shutdown()
          
private static uint size_class_of( size_t size_pa )
          
private void stats_notify_alloc( size_t size_pa )
          
private void stats_notify_free( size_t size_pa )
          
private void stats_reset()
          
 

Field Detail

>

private cassert( BUF_ALIGN >;

alloc_checker

private AllocatorChecker alloc_checker;

allocated_size_total_pa

private size_t allocated_size_total_pa;

bitmap

private uintptr_t bitmap;

FOOTER_ID

private static const u32 FOOTER_ID;

free_size_total_pa

private size_t free_size_total_pa;

freelists

private CacheAllocator::Header freelists[ sizeof ( uintptr_t ) * CHAR_BIT ];

HEADER_ID

private static const u32 HEADER_ID;

MAGIC

private static const u32 MAGIC;

pool

private Pool pool;


Constructor Detail

CacheAllocator

public CacheAllocator();


Method Detail

alloc

public void* alloc( size_t size );

alloc_from_class

private void* alloc_from_class( uint size_class, size_t size_pa );

alloc_from_larger_class

private void* alloc_from_larger_class( uint start_size_class, size_t size_pa );

coalesce_and_free

private void coalesce_and_free( u8* p, size_t size_pa );

dealloc

public void dealloc( u8* p, size_t size );

freelist_add

private void freelist_add( u8* p, size_t size_pa );

freelist_remove

private void freelist_remove( CacheAllocator::Header* header );

is_valid_tag

private bool is_valid_tag( u32 expected_id, u32 id, u32 magic, size_t size_pa ) const;

ls1

private static uint ls1( uint x );

make_read_only

public void make_read_only( u8* p, size_t size );

reset

public void reset();

self_check

private void self_check() const;

shutdown

public void shutdown();

size_class_of

private static uint size_class_of( size_t size_pa );

stats_notify_alloc

private void stats_notify_alloc( size_t size_pa );

stats_notify_free

private void stats_notify_free( size_t size_pa );

stats_reset

private void stats_reset();

 Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
Generated on September 04, 2007 at 18:13
CppDoc v2.4.0
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD