|
0 A.D. | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Field Summary | |
cassert( |
16+ 32 <
See h_mgr.cpp |
static i32 |
first_free
See h_mgr.cpp |
static Pool |
fn_pool
See h_mgr.cpp |
static const size_t |
FN_POOL_EL_SIZE
See h_mgr.cpp |
const size_t |
H_STRING_LEN
user_size is checked to make sure the user data fits in the handle data space. |
static const i32 |
hdata_cap
See h_mgr.cpp |
static const uint |
hdata_per_page
See h_mgr.cpp |
static const size_t |
HDATA_USER_SIZE
See h_mgr.cpp |
const u32 |
IDX_MASK
See h_mgr.cpp |
const uint |
IDX_SHIFT
See h_mgr.cpp |
static ModuleInitState |
initState
See h_mgr.cpp |
static OverrunProtector< Key2Idx > |
key2idx_wrapper
See h_mgr.cpp |
static i32 |
last_in_use
See h_mgr.cpp |
static const uint |
MAX_EXTANT_HANDLES
========================================================================= File : h_mgr. |
static pthread_mutex_t |
mutex
========================================================================= File : mem. |
static const uint |
num_pages
See h_mgr.cpp |
static const size_t |
PAGE_SIZE
See h_mgr.cpp |
static HDATA*[ num_pages ] |
pages
See h_mgr.cpp |
static OverrunProtector< Ptr2H > |
ptr2h_wrapper
See mem.cpp |
static const uint |
REF_BITS
See h_mgr.cpp |
static const u32 |
REF_MAX
See h_mgr.cpp |
const u32 |
TAG_MASK
See h_mgr.cpp |
const uint |
TAG_SHIFT
See h_mgr.cpp |
static const uint |
TYPE_BITS
See h_mgr.cpp |
Method Summary | |
static LibError |
alloc_idx( i32& idx, HDATA*& hd )
See h_mgr.cpp |
static Handle |
alloc_new_handle( H_Type type, const char* fn, uintptr_t key, uint flags, va_list* init_args )
See h_mgr.cpp |
static LibError |
call_init_and_reload( Handle h, H_Type type, HDATA* hd, const char* fn, va_list* init_args )
See h_mgr.cpp |
|
ERROR_ASSOCIATE( ERR::RES_UNKNOWN_FORMAT,"Unknown file format",-1 )
========================================================================= File : res. |
|
ERROR_ASSOCIATE( ERR::RES_INCOMPLETE_HEADER,"File header not completely read",-1 )
See res.cpp |
static Handle |
find_alloc( void* target_raw_p, It* out_it = 0 )
See mem.cpp |
static void |
fn_free( HDATA* hd )
See h_mgr.cpp |
static void |
fn_init()
See h_mgr.cpp |
static bool |
fn_is_in_HDATA( HDATA* hd )
See h_mgr.cpp |
static void |
fn_shutdown()
See h_mgr.cpp |
static void |
fn_store( HDATA* hd, const char* fn )
See h_mgr.cpp |
static LibError |
free_idx( i32 idx )
See h_mgr.cpp |
static u32 |
gen_tag()
See h_mgr.cpp |
void |
h_add_ref( Handle h )
See h_mgr.cpp |
Handle |
h_alloc( H_Type type, const char* fn, uint flags,... )
See h_mgr.cpp |
static HDATA* |
h_data_from_idx( const i32 idx )
See h_mgr.cpp |
static inline HDATA* |
h_data_no_tag( const Handle h )
See h_mgr.cpp |
static inline HDATA* |
h_data_tag( const Handle h )
See h_mgr.cpp |
static HDATA* |
h_data_tag_type( const Handle h, const H_Type type )
See h_mgr.cpp |
const char* |
h_filename( const Handle h )
See h_mgr.cpp |
Handle |
h_find( H_Type type, uintptr_t key )
See h_mgr.cpp |
LibError |
h_force_free( Handle h, H_Type type )
See h_mgr.cpp |
LibError |
h_free( Handle& h, H_Type type )
See h_mgr.cpp |
static LibError |
h_free_idx( i32 idx, HDATA* hd )
See h_mgr.cpp |
int |
h_get_refcnt( Handle h )
See h_mgr.cpp |
static inline u32 |
h_idx( const Handle h )
See h_mgr.cpp |
void |
h_mgr_init()
See h_mgr.cpp |
void |
h_mgr_shutdown()
See h_mgr.cpp |
LibError |
h_reload( const char* fn )
See h_mgr.cpp |
static inline u32 |
h_tag( const Handle h )
See h_mgr.cpp |
|
H_TYPE_DEFINE( Mem )
See mem.cpp |
void* |
h_user_data( const Handle h, const H_Type type )
See h_mgr.cpp |
static inline Handle |
handle( const u32 _idx, const u32 tag )
See h_mgr.cpp |
static void* |
heap_alloc( size_t raw_size, uintptr_t& ctx )
See mem.cpp |
static void |
heap_free( void* raw_p, size_t UNUSED( raw_size ), uintptr_t UNUSED( ctx ) )
See mem.cpp |
static void |
key_add( uintptr_t key, Handle h )
See h_mgr.cpp |
static Handle |
key_find( uintptr_t key, H_Type type, KeyRemoveFlag remove_option = KEY_NOREMOVE )
See h_mgr.cpp |
static void |
key_remove( uintptr_t key, H_Type type )
See h_mgr.cpp |
void* |
mem_alloc( size_t size, const size_t align, uint flags, Handle* phm )
See mem.cpp |
static void |
Mem_dtor( Mem* m )
See mem.cpp |
LibError |
mem_free_h( Handle& hm )
See mem.cpp |
LibError |
mem_free_p( void*& p )
See mem.cpp |
LibError |
mem_get( Handle hm, u8** pp, size_t* psize )
See mem.cpp |
void* |
mem_get_ptr( Handle hm, size_t* user_size )
See mem.cpp |
static void |
Mem_init( Mem* m, va_list args )
See mem.cpp |
static LibError |
Mem_reload( Mem* m, const char* UNUSED( fn ), Handle hm )
See mem.cpp |
void |
mem_shutdown()
See mem.cpp |
static LibError |
Mem_to_string( const Mem* m, char* buf )
See mem.cpp |
static LibError |
Mem_validate( const Mem* m )
See mem.cpp |
Handle |
mem_wrap( void* p, size_t size, uint flags, void* raw_p, size_t raw_size, MEM_DTOR dtor, uintptr_t ctx, void* owner )
See mem.cpp |
static void |
remove_alloc( void* raw_p )
See mem.cpp |
static Handle |
reuse_existing_handle( uintptr_t key, H_Type type, uint flags )
See h_mgr.cpp |
static void |
set_alloc( void* raw_p, Handle hm )
See mem.cpp |
static LibError |
type_validate( H_Type type )
See h_mgr.cpp |
static void |
warn_if_invalid( HDATA* hd )
See h_mgr.cpp |
Symbol Summary | |
#define |
IDX_BITS 16
See h_mgr.cpp |
#define |
INCLUDED_H_MGR
See h_mgr.h |
#define |
INCLUDED_HANDLE
See handle.h |
#define |
INCLUDED_MEM
See mem.h |
#define |
INCLUDED_RES
See res.h |
#define |
SCOPED_LOCK ScopedLock UID__
See mem.cpp |
#define |
TAG_BITS 32
See h_mgr.cpp |
Macro Summary | |
#define |
H_DEREF(h, type, varif(h < 0WARN_RETURN((LibErrorhtype*) const var = H_USER_DATA(h, type)if(!var)WARN_RETURN(ERR::INVALID_HANDLE)
See h_mgr.h |
#define |
H_TYPE_DEFINE(typestatic) void type##_init(type*, va_list)static LibError type##_reload(type*, const char*, Handle)static void type##_dtor(type*)static LibError type##_validate(const type*)static LibError type##_to_string(const type*, char* buf)static H_VTbl V_##type ={(void (*)(void*, va_list))type##_init,(LibError (*)(void*, const char*, Handle))type##_reload,(void (*)(void*))type##_dtor,(LibError (*)(const void*))type##_validate,(LibError (*)(const void*, char*))type##_to_string,sizeof(type), #type }static H_Type H_##type = &V_##type
See h_mgr.h |
#define |
H_USER_DATA(h, type) (type*)h_user_data(h, H_##type)
See h_mgr.h |
#define |
mem_free(p) mem_free_p((void*&)p)
See mem.h |
Field Detail |
cassert( 16+ 32 <;
static i32 first_free;
static Pool fn_pool;
static const size_t FN_POOL_EL_SIZE;
const size_t H_STRING_LEN;
static const i32 hdata_cap;
static const uint hdata_per_page;
static const size_t HDATA_USER_SIZE;
const u32 IDX_MASK;
const uint IDX_SHIFT;
static ModuleInitState initState;
static OverrunProtector< Key2Idx > key2idx_wrapper;
static i32 last_in_use;
static const uint MAX_EXTANT_HANDLES;
static pthread_mutex_t mutex;
static const uint num_pages;
static const size_t PAGE_SIZE;
static HDATA* pages[ num_pages ];
static OverrunProtector< Ptr2H > ptr2h_wrapper;
static const uint REF_BITS;
static const u32 REF_MAX;
const u32 TAG_MASK;
const uint TAG_SHIFT;
static const uint TYPE_BITS;
Method Detail |
static LibError alloc_idx( i32& idx, HDATA*& hd );
static Handle alloc_new_handle( H_Type type, const char* fn, uintptr_t key, uint flags, va_list* init_args );
static LibError call_init_and_reload( Handle h, H_Type type, HDATA* hd, const char* fn, va_list* init_args );
ERROR_ASSOCIATE( ERR::RES_UNKNOWN_FORMAT,"Unknown file format",-1 );
ERROR_ASSOCIATE( ERR::RES_INCOMPLETE_HEADER,"File header not completely read",-1 );
static Handle find_alloc( void* target_raw_p, It* out_it = 0 );
static void fn_free( HDATA* hd );
static void fn_init();
static bool fn_is_in_HDATA( HDATA* hd );
static void fn_shutdown();
static void fn_store( HDATA* hd, const char* fn );
static LibError free_idx( i32 idx );
static u32 gen_tag();
void h_add_ref( Handle h );
Handle h_alloc( H_Type type, const char* fn, uint flags,... );
static HDATA* h_data_from_idx( const i32 idx );
static inline HDATA* h_data_no_tag( const Handle h );
static inline HDATA* h_data_tag( const Handle h );
static HDATA* h_data_tag_type( const Handle h, const H_Type type );
const char* h_filename( const Handle h );
Handle h_find( H_Type type, uintptr_t key );
LibError h_force_free( Handle h, H_Type type );
LibError h_free( Handle& h, H_Type type );
static LibError h_free_idx( i32 idx, HDATA* hd );
int h_get_refcnt( Handle h );
static inline u32 h_idx( const Handle h );
void h_mgr_init();
void h_mgr_shutdown();
LibError h_reload( const char* fn );
static inline u32 h_tag( const Handle h );
H_TYPE_DEFINE( Mem );
void* h_user_data( const Handle h, const H_Type type );
static inline Handle handle( const u32 _idx, const u32 tag );
static void* heap_alloc( size_t raw_size, uintptr_t& ctx );
static void heap_free( void* raw_p, size_t UNUSED( raw_size ), uintptr_t UNUSED( ctx ) );
static void key_add( uintptr_t key, Handle h );
static Handle key_find( uintptr_t key, H_Type type, KeyRemoveFlag remove_option = KEY_NOREMOVE );
static void key_remove( uintptr_t key, H_Type type );
void* mem_alloc( size_t size, const size_t align, uint flags, Handle* phm );
static void Mem_dtor( Mem* m );
LibError mem_free_h( Handle& hm );
LibError mem_free_p( void*& p );
LibError mem_get( Handle hm, u8** pp, size_t* psize );
void* mem_get_ptr( Handle hm, size_t* user_size );
static void Mem_init( Mem* m, va_list args );
static LibError Mem_reload( Mem* m, const char* UNUSED( fn ), Handle hm );
void mem_shutdown();
static LibError Mem_to_string( const Mem* m, char* buf );
static LibError Mem_validate( const Mem* m );
Handle mem_wrap( void* p, size_t size, uint flags, void* raw_p, size_t raw_size, MEM_DTOR dtor, uintptr_t ctx, void* owner );
static void remove_alloc( void* raw_p );
static Handle reuse_existing_handle( uintptr_t key, H_Type type, uint flags );
static void set_alloc( void* raw_p, Handle hm );
static LibError type_validate( H_Type type );
static void warn_if_invalid( HDATA* hd );
Symbol Detail |
#define IDX_BITS 16
#define INCLUDED_H_MGR
#define INCLUDED_HANDLE
#define INCLUDED_MEM
#define INCLUDED_RES
#define SCOPED_LOCK ScopedLock UID__;
#define TAG_BITS 32
Macro Detail |
#define H_DEREF(h, type, varif(h < 0WARN_RETURN((LibErrorh;type*) const var = H_USER_DATA(h, type);if(!var)WARN_RETURN(ERR::INVALID_HANDLE);
#define H_TYPE_DEFINE(typestatic) void type##_init(type*, va_list);static LibError type##_reload(type*, const char*, Handle);static void type##_dtor(type*);static LibError type##_validate(const type*);static LibError type##_to_string(const type*, char* buf);static H_VTbl V_##type ={(void (*)(void*, va_list))type##_init,(LibError (*)(void*, const char*, Handle))type##_reload,(void (*)(void*))type##_dtor,(LibError (*)(const void*))type##_validate,(LibError (*)(const void*, char*))type##_to_string,sizeof(type), #type };static H_Type H_##type = &V_##type
#define H_USER_DATA(h, type) (type*)h_user_data(h, H_##type)
#define mem_free(p) mem_free_p((void*&)p)
|
0 A.D.
Generated on September 04, 2007 at 18:13 CppDoc v2.4.0 |
|||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |