mempool.h File Reference

#include "defs.h"

Include dependency graph for mempool.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mem_pool

Defines

#define TYPE_ALLOCA(type)   ((type *)alloca(sizeof(type)))
#define TYPE_ALLOCA_N(type, n)   ((type *)alloca(sizeof(type) * (n)))
#define Malloc_Mem_Pool   (MEM_POOL *) 1
#define Default_Mem_Pool   (MEM_POOL *) 0
#define MEM_STAT_ARGS(line, file)   ,INT32 line, const char *file
#define MEM_POOL_Zeroed(pool)   ((pool)->bz)
#define MEM_POOL_Alloc(pool, size)   MEM_POOL_Alloc_P(pool,size,__LINE__,__FILE__)
#define MEM_POOL_Realloc(pool, o, os, ns)   MEM_POOL_Realloc_P((pool),(o),(os),(ns),__LINE__,__FILE__)
#define MEM_POOL_Push(pool)   MEM_POOL_Push_P(pool,__LINE__,__FILE__)
#define MEM_POOL_Push_Freeze(pool)   MEM_POOL_Push_Freeze_P(pool,__LINE__,__FILE__)
#define MEM_POOL_Pop(pool)   MEM_POOL_Pop_P(pool,__LINE__,__FILE__)
#define MEM_POOL_Pop_Unfreeze(pool)   MEM_POOL_Pop_Unfreeze_P(pool,__LINE__,__FILE__)
#define MEM_POOL_Initialize(pool, name, bz)   MEM_POOL_Initialize_P(pool,name,bz,__LINE__,__FILE__)
#define TYPE_MEM_POOL_ALLOC(type, pool)   ((type *) MEM_POOL_Alloc(pool,sizeof(type)))
#define TYPE_MEM_POOL_ALLOC_N(type, pool, n)   ((type *) MEM_POOL_Alloc(pool,sizeof(type) * (n)))
#define TYPE_MEM_POOL_REALLOC_N(type, pool, old_block, old_n, new_n)
#define L_Save()   MEM_POOL_Push(MEM_local_pool_ptr)
#define L_Alloc(x)   MEM_POOL_Alloc(MEM_local_pool_ptr,(x))
#define L_Free()   MEM_POOL_Pop(MEM_local_pool_ptr)
#define P_Alloc(x)   MEM_POOL_Alloc(MEM_phase_pool_ptr,(x))
#define Src_Alloc(x)   MEM_POOL_Alloc(MEM_src_pool_ptr,(x))
#define Pu_Alloc(x)   MEM_POOL_Alloc(MEM_pu_pool_ptr,(x))
#define TYPE_L_ALLOC(type)   ((type*)L_Alloc(sizeof(type)))
#define TYPE_L_ALLOC_N(type, n)   ((type*)L_Alloc(sizeof(type)*(n)))
#define TYPE_P_ALLOC(type)   ((type*)P_Alloc(sizeof(type)))
#define TYPE_P_ALLOC_N(type, n)   ((type*)P_Alloc(sizeof(type)*(n)))
#define TYPE_PU_ALLOC(type)   ((type*)Pu_Alloc(sizeof(type)))
#define TYPE_PU_ALLOC_N(type, n)   ((type*)Pu_Alloc(sizeof(type)*(n)))
#define TYPE_SRC_ALLOC(type)   ((type*)Src_Alloc(sizeof(type)))
#define TYPE_SRC_ALLOC_N(type, n)   ((type*)Src_Alloc(sizeof(type)*(n)))

Typedefs

typedef struct mem_block MEM_BLOCK
typedef struct mem_pool_blocks MEM_POOL_BLOCKS
typedef struct mem_stat MEM_STAT
typedef struct mem_pure_stack MEM_PURE_STACK
typedef struct mem_pool MEM_POOL

Functions

void MEM_Initialize (void)
void MEM_Trace (void)
void Trace_Memory_Allocation (INT phase, const char *pname)
void MEM_Tracing_Enable (void)
MEM_PTR MEM_POOL_Alloc_P (MEM_POOL *mempool, size_t size)
MEM_PTR MEM_POOL_Realloc_P (MEM_POOL *mempool, MEM_PTR old_block, size_t old_size, size_t new_size)
void MEM_POOL_Push_P (MEM_POOL *pool)
void MEM_POOL_Push_Freeze_P (MEM_POOL *pool)
void MEM_POOL_Pop_P (MEM_POOL *pool)
void MEM_POOL_Pop_Unfreeze_P (MEM_POOL *pool)
void MEM_POOL_Set_Default (MEM_POOL *pool)
void MEM_POOL_FREE (MEM_POOL *pool, void *data)
void MEM_POOL_Delete (MEM_POOL *pool)
void MEM_POOL_Initialize_P (MEM_POOL *pool, const char *name, BOOL bz)
MEM_PTR Realloc_Clear (MEM_PTR ptr, INT32 new_size, INT32 old_size)
MEM_PTR Re_Calloc (MEM_PTR ptr, INT32 new_nelem, INT32 elsize, INT32 old_nelem)

Variables

MEM_POOL MEM_local_pool
MEM_POOL MEM_src_pool
MEM_POOL MEM_pu_pool
MEM_POOL MEM_phase_pool
MEM_POOLMEM_local_pool_ptr
MEM_POOLMEM_src_pool_ptr
MEM_POOLMEM_pu_pool_ptr
MEM_POOLMEM_phase_pool_ptr
MEM_POOL MEM_local_nz_pool
MEM_POOL MEM_src_nz_pool
MEM_POOL MEM_pu_nz_pool
MEM_POOL MEM_phase_nz_pool
MEM_POOLMEM_local_nz_pool_ptr
MEM_POOLMEM_src_nz_pool_ptr
MEM_POOLMEM_pu_nz_pool_ptr
MEM_POOLMEM_phase_nz_pool_ptr


Define Documentation

#define Default_Mem_Pool   (MEM_POOL *) 0

#define L_Alloc (  )     MEM_POOL_Alloc(MEM_local_pool_ptr,(x))

Definition at line 665 of file mempool.h.

 
#define L_Free (  )     MEM_POOL_Pop(MEM_local_pool_ptr)

Definition at line 666 of file mempool.h.

 
#define L_Save (  )     MEM_POOL_Push(MEM_local_pool_ptr)

Definition at line 664 of file mempool.h.

#define Malloc_Mem_Pool   (MEM_POOL *) 1

#define MEM_POOL_Alloc ( pool,
size   )     MEM_POOL_Alloc_P(pool,size,__LINE__,__FILE__)

#define MEM_POOL_Initialize ( pool,
name,
bz   )     MEM_POOL_Initialize_P(pool,name,bz,__LINE__,__FILE__)

#define MEM_POOL_Pop ( pool   )     MEM_POOL_Pop_P(pool,__LINE__,__FILE__)

#define MEM_POOL_Pop_Unfreeze ( pool   )     MEM_POOL_Pop_Unfreeze_P(pool,__LINE__,__FILE__)

Definition at line 622 of file mempool.h.

#define MEM_POOL_Push ( pool   )     MEM_POOL_Push_P(pool,__LINE__,__FILE__)

#define MEM_POOL_Push_Freeze ( pool   )     MEM_POOL_Push_Freeze_P(pool,__LINE__,__FILE__)

Definition at line 616 of file mempool.h.

Referenced by Process_Fill_Align_Pragmas().

#define MEM_POOL_Realloc ( pool,
o,
os,
ns   )     MEM_POOL_Realloc_P((pool),(o),(os),(ns),__LINE__,__FILE__)

#define MEM_POOL_Zeroed ( pool   )     ((pool)->bz)

Definition at line 509 of file mempool.h.

Referenced by _X_PROP_CREATE_(), BS_Create_Empty(), and bs_Realloc().

#define MEM_STAT_ARGS ( line,
file   )     ,INT32 line, const char *file

Definition at line 504 of file mempool.h.

#define P_Alloc (  )     MEM_POOL_Alloc(MEM_phase_pool_ptr,(x))

Definition at line 668 of file mempool.h.

#define Pu_Alloc (  )     MEM_POOL_Alloc(MEM_pu_pool_ptr,(x))

Definition at line 670 of file mempool.h.

Referenced by Symtab_Alloc().

#define Src_Alloc (  )     MEM_POOL_Alloc(MEM_src_pool_ptr,(x))

#define TYPE_ALLOCA ( type   )     ((type *)alloca(sizeof(type)))

Definition at line 434 of file mempool.h.

#define TYPE_ALLOCA_N ( type,
 )     ((type *)alloca(sizeof(type) * (n)))

Definition at line 435 of file mempool.h.

#define TYPE_L_ALLOC ( type   )     ((type*)L_Alloc(sizeof(type)))

Definition at line 672 of file mempool.h.

Referenced by AddToDUMPDEP().

#define TYPE_L_ALLOC_N ( type,
 )     ((type*)L_Alloc(sizeof(type)*(n)))

Definition at line 673 of file mempool.h.

#define TYPE_MEM_POOL_ALLOC ( type,
pool   )     ((type *) MEM_POOL_Alloc(pool,sizeof(type)))

#define TYPE_MEM_POOL_ALLOC_N ( type,
pool,
 )     ((type *) MEM_POOL_Alloc(pool,sizeof(type) * (n)))

#define TYPE_MEM_POOL_REALLOC_N ( type,
pool,
old_block,
old_n,
new_n   ) 

Value:

((type *) MEM_POOL_Realloc(pool,((MEM_PTR) old_block),              \
                                    (sizeof(type) * (old_n)),           \
                                    (sizeof(type) * (new_n))))

Definition at line 656 of file mempool.h.

Referenced by bs_Realloc(), Init_PU_arg_area_size_array(), ir_a2b::MapFlagsToStr(), new_block(), PRQ_Insert(), Realloc_ST_formal_info(), and WN_MAP_Add_Free_List().

#define TYPE_P_ALLOC ( type   )     ((type*)P_Alloc(sizeof(type)))

Definition at line 674 of file mempool.h.

#define TYPE_P_ALLOC_N ( type,
 )     ((type*)P_Alloc(sizeof(type)*(n)))

Definition at line 675 of file mempool.h.

#define TYPE_PU_ALLOC ( type   )     ((type*)Pu_Alloc(sizeof(type)))

Definition at line 676 of file mempool.h.

#define TYPE_PU_ALLOC_N ( type,
 )     ((type*)Pu_Alloc(sizeof(type)*(n)))

Definition at line 677 of file mempool.h.

#define TYPE_SRC_ALLOC ( type   )     ((type*)Src_Alloc(sizeof(type)))

Definition at line 678 of file mempool.h.

#define TYPE_SRC_ALLOC_N ( type,
 )     ((type*)Src_Alloc(sizeof(type)*(n)))

Definition at line 679 of file mempool.h.


Typedef Documentation

typedef struct mem_block MEM_BLOCK

Definition at line 447 of file mempool.h.

typedef struct mem_pool MEM_POOL

Definition at line 467 of file mempool.h.

Definition at line 451 of file mempool.h.

Definition at line 459 of file mempool.h.

typedef struct mem_stat MEM_STAT

Definition at line 455 of file mempool.h.


Function Documentation

void MEM_Initialize ( void   ) 

Definition at line 1861 of file memory.c.

References DevWarn(), FALSE, MEM_POOL_Initialize, MEM_POOL_Push, purify_pools, purify_pools_trace, purify_pools_trace_x, and TRUE.

Referenced by main(), xaif2whirl::real_main(), and real_main().

Here is the call graph for this function:

MEM_PTR MEM_POOL_Alloc_P ( MEM_POOL mempool,
size_t  size 
)

void MEM_POOL_Delete ( MEM_POOL pool  ) 

void MEM_POOL_FREE ( MEM_POOL pool,
void *  data 
)

void MEM_POOL_Initialize_P ( MEM_POOL pool,
const char *  name,
BOOL  bz 
)

void MEM_POOL_Pop_P ( MEM_POOL pool  ) 

void MEM_POOL_Pop_Unfreeze_P ( MEM_POOL pool  ) 

Definition at line 1584 of file memory.c.

References FALSE, FmtAssert, Is_True, MAGIC_NUM, MEM_POOL_frozen, MEM_POOL_magic_num, MEM_POOL_name, MEM_POOL_Pop_P(), purify_pools_trace_x, and TRUE.

Here is the call graph for this function:

void MEM_POOL_Push_Freeze_P ( MEM_POOL pool  ) 

Definition at line 1439 of file memory.c.

References FALSE, FmtAssert, Is_True, MAGIC_NUM, MEM_POOL_frozen, MEM_POOL_magic_num, MEM_POOL_name, MEM_POOL_Push_P(), purify_pools_trace_x, and TRUE.

Here is the call graph for this function:

void MEM_POOL_Push_P ( MEM_POOL pool  ) 

MEM_PTR MEM_POOL_Realloc_P ( MEM_POOL mempool,
MEM_PTR  old_block,
size_t  old_size,
size_t  new_size 
)

void MEM_POOL_Set_Default ( MEM_POOL pool  ) 

Definition at line 1600 of file memory.c.

Referenced by BINARY_TREE< BINARY_NODE >::~BINARY_TREE().

void MEM_Trace ( void   ) 

Definition at line 852 of file memory.c.

References MEM_POOL_Report(), MEM_POOL_rest, NULL, and TFile.

Referenced by FreeIR(), Ipl_Processing(), main(), and Trace_Memory_Allocation().

Here is the call graph for this function:

void MEM_Tracing_Enable ( void   ) 

Definition at line 922 of file memory.c.

References mem_tracing_enabled, and TRUE.

Referenced by main(), xaif2whirl::real_main(), and real_main().

MEM_PTR Re_Calloc ( MEM_PTR  ptr,
INT32  new_nelem,
INT32  elsize,
INT32  old_nelem 
)

Definition at line 2000 of file memory.c.

References Realloc_Clear().

Here is the call graph for this function:

MEM_PTR Realloc_Clear ( MEM_PTR  ptr,
INT32  new_size,
INT32  old_size 
)

Definition at line 1955 of file memory.c.

References EC_No_Mem, ErrMsg(), and NULL.

Referenced by Re_Calloc().

Here is the call graph for this function:

void Trace_Memory_Allocation ( INT  phase,
const char *  pname 
)

Definition at line 900 of file memory.c.

References DBar, Get_Trace(), MEM_Trace(), TFile, and TKIND_ALLOC.

Here is the call graph for this function:


Variable Documentation

Definition at line 92 of file memory.c.

Definition at line 97 of file memory.c.

Referenced by Write_PU_Info().

Definition at line 78 of file memory.c.

Referenced by WB_BROWSER::Ancestors(), Ipl_Processing(), IR_reader_init(), and WB_BROWSER::Parent().

Definition at line 83 of file memory.c.

Definition at line 95 of file memory.c.

Definition at line 100 of file memory.c.

Definition at line 81 of file memory.c.

Definition at line 86 of file memory.c.

Definition at line 80 of file memory.c.

Referenced by Backend_Processing(), Do_WOPT_and_CG_with_Regions(), and Preprocess_PU().

Definition at line 93 of file memory.c.

Referenced by FreeIR(), main(), and ReadIR().

Definition at line 98 of file memory.c.

Definition at line 84 of file memory.c.

Referenced by create_ipa_internal_name(), DST_enter_cloned_childs(), new_block(), and New_DST().


Generated on Fri Jul 24 05:02:46 2009 for OpenADFortTk (extended to Open64) by  doxygen 1.5.7.1