/[radius]/radius/include/mem.h
ViewVC logotype

Diff of /radius/include/mem.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by gray, Wed Apr 30 08:44:33 2003 UTC revision 1.13 by gray, Tue Jun 3 14:17:27 2003 UTC
# Line 19  Line 19 
19  #ifndef __mem_h  #ifndef __mem_h
20  #define __mem_h  #define __mem_h
21    
 #define MEM_PAGESIZE 4096  
 #ifndef MINSTRSIZE  
 # define MINSTRSIZE  32  
 #endif  
   
22  typedef unsigned count_t;  typedef unsigned count_t;
23  typedef double Align_t;  typedef double Align_t;
24  struct mallocstat {  struct mallocstat {
# Line 32  struct mallocstat { Line 27  struct mallocstat {
27  };  };
28  extern struct mallocstat mallocstat;  extern struct mallocstat mallocstat;
29    
 typedef struct {  
         unsigned class_cnt;  
         unsigned bucket_cnt;  
         unsigned bytes_allocated;  
         unsigned bytes_used;  
 } MEM_STAT;  
   
 typedef struct {  
         int         index;  
         int         cont;            /* Allow contiguous allocation */  
         size_t      elsize;          /* Size of an element */  
         count_t     elcnt;           /* Number of elements per bucket */  
         count_t     allocated_cnt;   /* Number of allocated elements */  
         count_t     bucket_cnt;      /* Number of buckets */  
 } CLASS_STAT;  
   
   
 void *mem_alloc(size_t size);  
 void mem_free(void *ptr);  
 void *mem_calloc(count_t count, size_t size);  
 void mem_cfree(void *ptr, count_t count);  
   
30  void *radxmalloc(size_t);  void *radxmalloc(size_t);
31  void *emalloc(size_t);  void *emalloc(size_t);
32  void *radxrealloc(void *, size_t);  void *radxrealloc(void *, size_t);
# Line 61  void *erealloc(void *, size_t); Line 34  void *erealloc(void *, size_t);
34  void efree(void *);  void efree(void *);
35  char *estrdup(char *);  char *estrdup(char *);
36    
 char *string_alloc(size_t length);  
 char *string_create(char *str);  
 char *string_dup(char *str);  
 void string_free(char *str);  
37  char *string_replace(char **str, char *value);  char *string_replace(char **str, char *value);
38    
 void mem_get_stat(MEM_STAT *stat);  
 int mem_stat_enumerate(int (*fun)(), void *closure);  
   
39  #endif  #endif

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26