00001 /* 00002 ** sfmemcap.h 00003 */ 00004 #ifndef __SF_MEMCAP_H__ 00005 #define __SF_MEMCAP_H__ 00006 00007 typedef struct 00008 { 00009 unsigned memused; 00010 unsigned memcap; 00011 int nblocks; 00012 00013 }MEMCAP; 00014 00015 void sfmemcap_init(MEMCAP * mc, unsigned nbytes); 00016 MEMCAP * sfmemcap_new( unsigned nbytes ); 00017 void sfmemcap_delete( MEMCAP * mc ); 00018 void * sfmemcap_alloc(MEMCAP * mc, unsigned nbytes); 00019 void sfmemcap_showmem(MEMCAP * mc ); 00020 void sfmemcap_free( MEMCAP * mc, void * memory); 00021 char * sfmemcap_strdup(MEMCAP * mc, const char *str); 00022 void * sfmemcap_dupmem(MEMCAP * mc, void * src, int n ); 00023 00024 #endif