cxx_memory.h File Reference

#include "mempool.h"
Include dependency graph for cxx_memory.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define CXX_USE_STANDARD_NEW_AND_DELETE
#define CXX_NEW(constructor, mempool)   (new constructor)
#define CXX_NEW_ARRAY(constructor, elements, mempool)   (new constructor[elements])
#define CXX_DELETE(pointer, mempool)   (delete pointer)
#define CXX_DELETE_ARRAY(pointer, mempool)   (delete[] pointer)

Define Documentation

#define CXX_DELETE ( pointer,
mempool   )     (delete pointer)
#define CXX_DELETE_ARRAY ( pointer,
mempool   )     (delete[] pointer)
#define CXX_NEW ( constructor,
mempool   )     (new constructor)

Definition at line 129 of file cxx_memory.h.

Referenced by Anl_Init(), Anl_Static_Analysis(), BE_symtab_alloc_scope_level(), LOOPINFO::Build_linex(), PROMPF_INFO::Cache_Tile(), PROMPF_INFO::Cache_Winddown(), CFG_NODE_INFO::CFG_NODE_INFO(), PROJECTED_REGION::Compare(), PROJECTED_NODE::Copy(), create_ipa_internal_name(), LOOPINFO::Create_linex(), PROJECTED_NODE::Create_linex(), cwh_auxst_register_table(), DIRECTED_GRAPH16< EDGE_TYPE, VERTEX_TYPE >::DIRECTED_GRAPH16(), PROMPF_INFO::Distribution(), PROMPF_INFO::Doacross_Inner_Tile(), PROMPF_INFO::Doacross_Outer_Tile(), PROMPF_INFO::Doacross_Sync(), PROMPF_INFO::Donest_Middle_Tile(), PROMPF_INFO::Donest_Outer_Tile(), DRA_Add_Clone(), DRA_Clone_Initialize(), DRA_Initialize(), DRA_Mangle_All(), DRA_Mangle_Call_Site(), DRA_Mangle_Entry(), DRA_Process_Requests(), DRA_Processing(), PROMPF_INFO::Dsm_Io(), PROMPF_INFO::Dsm_Local(), PROMPF_INFO::Dsm_Tile(), dV_view_whirl(), PROMPF_INFO::Elimination(), ANL_FUNC_ENTRY::Emit_Nested_Original_Constructs(), USER_HASH_TABLE< KEY_TYPE, DATA_TYPE, HASH_FUNC, KEY_EQ >::Enter(), HASH_TABLE< ST *, ST * >::Enter(), BINARY_TREE< BINARY_NODE >::Enter(), BINARY_TREE_NODE< BINARY_NODE >::Enter(), HASH_TABLE< SIG_TYPE, DATA_TYPE >::Enter_If_Unique(), PROMPF_INFO::F90_Array_Stmt(), fei_static_base(), ANL_VARLIST::Find_or_Insert(), PROMPF_INFO::Fission(), PROMPF_INFO::Fusion(), PROMPF_INFO::Gather_Scatter(), PROMPF_INFO::General_Version(), Get_Original_Type(), PROMPF_INFO::Hoist_Messy_Bounds(), PROJECTED_NODE::Init(), ARRAY_SUMMARY::Init(), CFG_NODE_INFO::Init(), REGION_ARRAYS::Init(), PROJECTED_KERNEL::Init(), PROMPF_INFO::Inner_Fission(), PROMPF_INFO::Inner_Shackle(), IPO_ADDR_HASH::Insert(), PROMPF_INFO::Interchange(), PROMPF_INFO::Interleaved_Winddown(), IPO_CLONE::IPO_CLONE(), IPO_SYMTAB::IPO_SYMTAB(), LOOPINFO::LOOPINFO(), main(), PROJECTED_REGION::Map_to_linex_array(), PROMPF_INFO::Mark_F90_Lower(), PROMPF_INFO::Mark_Omp(), PROMPF_INFO::Mark_Postlno(), PROMPF_INFO::Mark_Prelno(), PROMPF_INFO::Mark_Preopt(), LOOPINFO::Max_value(), PROJECTED_REGION::May_Union(), MemCtr_Add(), LINEX::Merge(), LOOPINFO::Min_value(), PROMPF_INFO::Mp_Tile(), PROMPF_INFO::Mp_Version(), New_DRA(), New_Scope(), PROMPF_INFO::OMPL_Atomic_To_Critical_Section(), PROMPF_INFO::OMPL_Atomic_To_FetchAndOp(), PROMPF_INFO::OMPL_Atomic_To_Swap(), PROMPF_INFO::OMPL_Eliminate_Section(), PROMPF_INFO::OMPL_Fetchop_Atomic(), PROMPF_INFO::OMPL_Master_To_If(), PROMPF_INFO::OMPL_Sections_To_Loop(), PROMPF_INFO::Outer_Shackle(), PROMPF_INFO::Parallel_Region(), PROMPF_INFO::Post_Peel(), PROMPF_INFO::Pre_Peel(), PROMPF_INFO::Prefetch_Version(), PROMPF_INFO::Preopt_Create(), Preprocess_PU(), Process_Fill_Align_Pragmas(), PROJECTED_KERNEL::Project(), PROJECTED_REGION::PROJECTED_REGION(), Projected_Region_From_Access_Array(), Projected_Region_From_St(), PROMPF_INFO::PROMPF_INFO(), PROMPF_INFO::Prompf_Info_Traverse(), REGION_ARRAYS::REGION_ARRAYS(), PROMPF_INFO::Register_Shutdown(), PROMPF_INFO::Register_SStrip(), PROMPF_INFO::Register_Startup(), PROMPF_INFO::Register_Tile(), PROMPF_INFO::Register_Winddown(), PROMPF_INFO::Remove_Unity_Trip(), RESHAPE::Reshape_Callee_To_Caller(), RESHAPE::Reshape_Constant_Shape(), Save_Local_Symtab(), PROMPF_INFO::Se_Cache_Tile(), PROMPF_INFO::Se_Tile(), PROJECTED_NODE::Set_constant_linexs(), PROJECTED_NODE::Set_constant_two_strided_section(), PROJECTED_REGION::Set_region(), PROJECTED_NODE::Set_to_kernel_image(), PROMPF_INFO::Single_Process(), Stab_initialize_flags(), LINEX::Subtract(), and PROMPF_INFO::Vintr_Fission().

#define CXX_NEW_ARRAY ( constructor,
elements,
mempool   )     (new constructor[elements])
#define CXX_USE_STANDARD_NEW_AND_DELETE

Description:

C++ macro replacements for new and delete using memory pools. new and delete should never be used in the compiler; these should be used instead.

Exported preprocessor macro

CXX_USE_STANDARD_NEW_AND_DELETE

If this preprocessor macro is defined, then the macros below just ignore the memory pools and call the normal new and delete.

Exported functions:

CXX_NEW(constructor, MEM_POOL*)

Use CXX_NEW instead of new. E.g.

X* x = new X(3,4);

should be replaced by

X* x = CXX_NEW(X(3,4), malloc_pool);

(or whatever appropriate pool name).

CXX_NEW_ARRAY(constructor, elements, MEM_POOL*)

Use CXX_NEW_ARRAY instead of new []. E.g.

X* x = new X[a*b];

should be replaced by

X* x = CXX_NEW_ARRAY(X, a*b, malloc_pool);

(or whatever appropriate pool name).

CXX_NEW_VARIANT(constructor, pad, MEM_POOL*)

Like CXX_NEW allocates an instance of type "constructor"

but allocates "pad" amount of extra storage

Could be viewed as X* x = (X*) malloc (sizeof(X)+pad)

Followed by a call to the constructor for X.

There is no C++ equivalent. Therefore not available when using

standard new and delete.

CXX_DELETE(pointer, MEM_POOL*)

Use CXX_DELETE instead of delete. E.g.

delete p;

should be replaced by

CXX_DELETE(p, malloc_pool);

(or whatever appropriate pool name).

CXX_DELETE_ARRAY(pointer, MEM_POOL*)

Use CXX_DELETE_ARRAY instead of delete[]. E.g.

delete[] p;

should be replaced by

CXX_DELETE_ARRAY(p, malloc_pool);

(or whatever appropriate pool name).

Definition at line 126 of file cxx_memory.h.


Generated on Tue Nov 17 06:15:01 2009 for Open64 (mfef90, whirl2f, and IR tools) by  doxygen 1.6.1