/Users/huttone/Devel/sedflux-new/sedflux/trunk/ew/utils/eh_mem.c File Reference

#include <eh_utils.h>
#include <stdlib.h>

Go to the source code of this file.

Classes

struct  Heap_Prefix
struct  Heap_Postfix

Defines

#define EH_MEM_TABLE_SIZE   (40960)
#define ALIGNMENT   (8)
#define DO_ALIGN(x)   (((x)+ALIGNMENT-1)&~(ALIGNMENT-1))

Typedefs

typedef Heap_PrefixHeap_Prefix
typedef Heap_PostfixHeap_Postfix
typedef Heap_Prefix Prefix
typedef Heap_Postfix Postfix

Enumerations

enum  Eh_mem_job { EH_MEM_PROFILE_MALLOC, EH_MEM_PROFILE_REALLOC, EH_MEM_PROFILE_FREE }

Functions

void eh_mem_profile_log (Eh_mem_job job, gulong size)
void eh_mem_profile_fprint (FILE *fp)
 eh_compiler_require (IS_POWER_2(ALIGNMENT))
 eh_compiler_require (!(sizeof(Prefix)%ALIGNMENT))
G_GNUC_INTERNAL void add_to_linked_list (Heap_Prefix)
G_GNUC_INTERNAL void remove_from_linked_list (Heap_Prefix)
G_GNUC_INTERNAL gboolean verify_heap_pointer (void *)
G_GNUC_INTERNAL gsize render_desc (Heap_Prefix, char *)
gpointer API_ENTRY eh_malloc (gsize w_size, Class_Desc desc, const char *file, int line_no)
gpointer API_ENTRY eh_malloc_c_style (gsize w_size)
gpointer API_ENTRY eh_calloc_c_style (gsize n_blocks, gsize n_block_bytes)
gpointer API_ENTRY eh_realloc (gpointer old, gsize w_size, const char *file, int line_no)
gpointer API_ENTRY eh_realloc_c_style (gpointer old, gsize w_size)
void API_ENTRY eh_walk_heap (void)
glong eh_mem_in_use (void)
gboolean API_ENTRY eh_is_ptr_ok (gpointer mem)
void API_ENTRY report_win_assert (char *file_name, int line_no)
void ** eh_alloc_2 (gssize m, gssize n, gssize size)
void eh_free_void_2 (void **p)


Define Documentation

#define ALIGNMENT   (8)

Definition at line 103 of file eh_mem.c.

Referenced by eh_is_ptr_ok().

#define DO_ALIGN (  )     (((x)+ALIGNMENT-1)&~(ALIGNMENT-1))

Definition at line 104 of file eh_mem.c.

Referenced by eh_malloc(), and eh_realloc().

#define EH_MEM_TABLE_SIZE   (40960)

Definition at line 5 of file eh_mem.c.

Referenced by eh_mem_profile_fprint(), and eh_mem_profile_log().


Typedef Documentation

typedef struct Heap_Postfix* Heap_Postfix

Definition at line 136 of file eh_mem.c.

typedef struct Heap_Prefix* Heap_Prefix

Definition at line 135 of file eh_mem.c.

typedef struct Heap_Postfix Postfix

typedef struct Heap_Prefix Prefix


Enumeration Type Documentation

enum Eh_mem_job

Enumerator:
EH_MEM_PROFILE_MALLOC 
EH_MEM_PROFILE_REALLOC 
EH_MEM_PROFILE_FREE 

Definition at line 15 of file eh_mem.c.


Function Documentation

void add_to_linked_list ( Heap_Prefix   ) 

Definition at line 438 of file eh_mem.c.

References Heap_Prefix::next, and Heap_Prefix::prev.

Referenced by eh_malloc(), and eh_realloc().

void** eh_alloc_2 ( gssize  m,
gssize  n,
gssize  size 
)

Definition at line 560 of file eh_mem.c.

References eh_new.

gpointer API_ENTRY eh_calloc_c_style ( gsize  n_blocks,
gsize  n_block_bytes 
)

Definition at line 222 of file eh_mem.c.

References eh_malloc().

Referenced by eh_init_glib().

eh_compiler_require ( (sizeof(Prefix)%ALIGNMENT)  ) 

eh_compiler_require ( IS_POWER_2(ALIGNMENT)   ) 

void eh_free_void_2 ( void **  p  ) 

Definition at line 590 of file eh_mem.c.

References eh_free.

gboolean API_ENTRY eh_is_ptr_ok ( gpointer  mem  ) 

Definition at line 500 of file eh_mem.c.

References ALIGNMENT.

Referenced by verify_heap_pointer().

gpointer API_ENTRY eh_malloc ( gsize  w_size,
Class_Desc  desc,
const char *  file,
int  line_no 
)

Definition at line 166 of file eh_mem.c.

References add_to_linked_list(), assert_error, DO_ALIGN, eh_mem_profile_log(), EH_MEM_PROFILE_MALLOC, and eh_require.

Referenced by eh_calloc_c_style(), eh_malloc_c_style(), and eh_realloc().

gpointer API_ENTRY eh_malloc_c_style ( gsize  w_size  ) 

Definition at line 206 of file eh_mem.c.

References eh_malloc().

Referenced by eh_init_glib().

glong eh_mem_in_use ( void   ) 

Definition at line 361 of file eh_mem.c.

void eh_mem_profile_fprint ( FILE *  fp  ) 

Definition at line 70 of file eh_mem.c.

References EH_MEM_TABLE_SIZE.

void eh_mem_profile_log ( Eh_mem_job  job,
gulong  size 
)

Definition at line 26 of file eh_mem.c.

References EH_MEM_PROFILE_FREE, EH_MEM_PROFILE_MALLOC, EH_MEM_PROFILE_REALLOC, and EH_MEM_TABLE_SIZE.

Referenced by eh_malloc(), and eh_realloc().

gpointer API_ENTRY eh_realloc ( gpointer  old,
gsize  w_size,
const char *  file,
int  line_no 
)

Definition at line 269 of file eh_mem.c.

References add_to_linked_list(), assert_error, DO_ALIGN, eh_malloc(), EH_MEM_PROFILE_FREE, eh_mem_profile_log(), EH_MEM_PROFILE_REALLOC, Heap_Prefix::mem, Heap_Prefix::postfix, Heap_Postfix::prefix, remove_from_linked_list(), and verify_heap_pointer().

Referenced by eh_realloc_c_style().

gpointer API_ENTRY eh_realloc_c_style ( gpointer  old,
gsize  w_size 
)

Definition at line 321 of file eh_mem.c.

References eh_free_c_style(), and eh_realloc().

Referenced by eh_init_glib().

void API_ENTRY eh_walk_heap ( void   ) 

Definition at line 341 of file eh_mem.c.

References Heap_Prefix::next, render_desc(), and verify_heap_pointer().

void remove_from_linked_list ( Heap_Prefix   ) 

Definition at line 456 of file eh_mem.c.

References Heap_Prefix::next, and Heap_Prefix::prev.

Referenced by eh_realloc().

gsize render_desc ( Heap_Prefix  ,
char *   
)

Definition at line 506 of file eh_mem.c.

References Heap_Prefix::class_desc, Heap_Prefix::file_name, Heap_Prefix::line_no, Heap_Prefix::mem, and Heap_Prefix::postfix.

Referenced by eh_walk_heap().

void API_ENTRY report_win_assert ( char *  file_name,
int  line_no 
)

Definition at line 551 of file eh_mem.c.

gboolean verify_heap_pointer ( void *   ) 

Definition at line 468 of file eh_mem.c.

References eh_is_ptr_ok(), Heap_Prefix::mem, Heap_Prefix::postfix, and Heap_Postfix::prefix.

Referenced by eh_realloc(), and eh_walk_heap().


Generated on Fri Jan 4 18:04:18 2008 for sedflux by  doxygen 1.5.2