Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
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_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(), 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(), DRA_Add_Clone(), DRA_Clone_Initialize(), DRA_Initialize(), DRA_Mangle_All(), DRA_Mangle_Call_Site(), DRA_Mangle_Entry(), DRA_Process_Requests(), DRA_Processing(), dV_view_whirl(), ANL_FUNC_ENTRY::Emit_Nested_Original_Constructs(), BINARY_TREE_NODE< BINARY_NODE >::Enter(), BINARY_TREE< BINARY_NODE >::Enter(), fei_static_base(), ANL_VARLIST::Find_or_Insert(), Get_Original_Type(), PROJECTED_NODE::Init(), PROJECTED_KERNEL::Init(), REGION_ARRAYS::Init(), CFG_NODE_INFO::Init(), ARRAY_SUMMARY::Init(), IPO_ADDR_HASH::Insert(), IPO_CLONE::IPO_CLONE(), IPO_SYMTAB::IPO_SYMTAB(), LOOPINFO::LOOPINFO(), main(), PROJECTED_REGION::Map_to_linex_array(), LOOPINFO::Max_value(), PROJECTED_REGION::May_Union(), MemCtr_Add(), LINEX::Merge(), LOOPINFO::Min_value(), New_DRA(), New_Scope(), Preprocess_PU(), Process_Fill_Align_Pragmas(), PROJECTED_KERNEL::Project(), PROJECTED_REGION::PROJECTED_REGION(), Projected_Region_From_Access_Array(), Projected_Region_From_St(), REGION_ARRAYS::REGION_ARRAYS(), Save_Local_Symtab(), PROJECTED_NODE::Set_constant_linexs(), PROJECTED_NODE::Set_constant_two_strided_section(), PROJECTED_REGION::Set_region(), PROJECTED_NODE::Set_to_kernel_image(), Stab_initialize_flags(), and LINEX::Subtract().

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.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines