Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
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 L_Alloc (   x)    MEM_POOL_Alloc(MEM_local_pool_ptr,(x))

Definition at line 665 of file mempool.h.

Definition at line 666 of file mempool.h.

Definition at line 664 of file mempool.h.

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

Definition at line 622 of file mempool.h.

Referenced by Anl_Static_Analysis().

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

Definition at line 616 of file mempool.h.

Referenced by Anl_Static_Analysis(), and Process_Fill_Align_Pragmas().

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

Definition at line 509 of file mempool.h.

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

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

Definition at line 504 of file mempool.h.

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

Definition at line 668 of file mempool.h.

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

Definition at line 670 of file mempool.h.

Referenced by Symtab_Alloc().

#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_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, getenv(), MEM_POOL_Initialize, MEM_POOL_Push, purify_pools, purify_pools_trace, purify_pools_trace_x, and TRUE.

Referenced by main(), and sgi_cmd_line().

Here is the call graph for this function:

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_Set_Default ( MEM_POOL pool)

Definition at line 1600 of file memory.c.

References pool.

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

void MEM_Trace ( void  )

Definition at line 852 of file memory.c.

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

Referenced by 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().

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(), NULL, and result.

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, fprintf(), 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 Ipl_Processing(), and IR_reader_init().

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 93 of file memory.c.

Referenced by main().

Definition at line 98 of file memory.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines