lib.res.file
Class CacheAllocator
in file_cache.cpp
- class CacheAllocator
>
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;
CacheAllocator
public CacheAllocator();
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();