Geant4  10.00.p01
hjmalloc.cc File Reference
#include <iostream>
#include <stdio.h>
#include <time.h>
#include "tls.hh"
#include "tpmalloc/mymalloc.h"
+ Include dependency graph for hjmalloc.cc:

Go to the source code of this file.

Macros

#define HJMALLOCDEBUG   0
 
#define HJMALLOCPROFILE   0
 
#define TLMSSIZE   256
 

Functions

void turnontpmalloc ()
 
void turnofftpmalloc ()
 
int tpmallocflag ()
 
void * malloc (size_t __size)
 
void * calloc (size_t __nmemb, size_t __size)
 
void * realloc (void *__ptr, size_t __size)
 
void free (void *__ptr)
 
void cfree (void *__ptr)
 
void * valloc (size_t __size)
 

Variables

G4ThreadLocal int mallocswitch = 0
 
G4ThreadLocal mspace tlms = 0
 
G4ThreadLocal long int alloccount = 0
 
G4ThreadLocal long int freecount = 0
 
G4ThreadLocal double alloctime = 0.0
 
G4ThreadLocal double freetime = 0.0
 

Macro Definition Documentation

#define HJMALLOCDEBUG   0

Definition at line 17 of file hjmalloc.cc.

#define HJMALLOCPROFILE   0

Definition at line 18 of file hjmalloc.cc.

#define TLMSSIZE   256

Definition at line 21 of file hjmalloc.cc.

Referenced by calloc(), malloc(), realloc(), and valloc().

Function Documentation

void* calloc ( size_t  __nmemb,
size_t  __size 
)

Definition at line 67 of file hjmalloc.cc.

References alloccount, alloctime, create_mspace(), mallocswitch, mspace_calloc(), tlms, and TLMSSIZE.

Referenced by zcalloc().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void cfree ( void *  __ptr)

Definition at line 174 of file hjmalloc.cc.

References freecount, freetime, mallocswitch, mspace_free(), and tlms.

+ Here is the call graph for this function:

void free ( void *  __ptr)

Definition at line 140 of file hjmalloc.cc.

References freecount, freetime, mallocswitch, mspace_free(), and tlms.

Referenced by G4PDefSplitter< T >::FreeSlave(), G4VUPLSplitter< T >::FreeSlave(), G4GeomSplitter< T >::FreeSlave(), gString_release(), gz_error(), gz_init(), gz_look(), gz_open(), gzclose_r(), gzclose_w(), gzdopen(), parserCreate(), G4VInteractorManager::SetArguments(), smr_release(), smr_setMessage(), tpi_spectralID_release(), tpia_misc_setMessageError_Element(), xData_free(), zcfree(), and G4VInteractorManager::~G4VInteractorManager().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void* malloc ( size_t  __size)

Definition at line 30 of file hjmalloc.cc.

References alloccount, alloctime, create_mspace(), mallocswitch, mspace_malloc(), tlms, and TLMSSIZE.

Referenced by G4EnhancedVecAllocator< _Tp >::allocate(), AllocateInProtectedHeap(), AllocateProtectedHeap(), gz_error(), gz_init(), gz_look(), gz_open(), gzdopen(), insertAddress(), parserCreate(), G4VInteractorManager::SetArguments(), toString(), xData_smrUserInterface(), and zcalloc().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void* realloc ( void *  __ptr,
size_t  __size 
)

Definition at line 103 of file hjmalloc.cc.

References alloccount, alloctime, create_mspace(), freecount, mallocswitch, mspace_realloc(), tlms, and TLMSSIZE.

Referenced by addStringToXML(), G4EnhancedVecAllocator< _Tp >::allocate(), G4GeomSplitter< T >::CreateSubInstance(), insertAddress(), G4PDefSplitter< T >::NewSubInstances(), G4VUPLSplitter< T >::NewSubInstances(), parserCreate(), G4GeomSplitter< T >::SlaveCopySubInstanceArray(), G4VUPLSplitter< T >::SlaveCopySubInstanceArray(), G4GeomSplitter< T >::SlaveInitializeSubInstance(), smr_setMessage(), smr_vallocateFormatMessage(), and xData_realloc().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int tpmallocflag ( )

Definition at line 28 of file hjmalloc.cc.

References mallocswitch.

void turnofftpmalloc ( )

Definition at line 27 of file hjmalloc.cc.

References mallocswitch.

void turnontpmalloc ( )

Definition at line 26 of file hjmalloc.cc.

References mallocswitch.

void* valloc ( size_t  __size)

Definition at line 208 of file hjmalloc.cc.

References alloccount, alloctime, create_mspace(), mallocswitch, mspace_malloc(), tlms, and TLMSSIZE.

+ Here is the call graph for this function:

Variable Documentation

G4ThreadLocal long int alloccount = 0

Definition at line 11 of file hjmalloc.cc.

Referenced by calloc(), malloc(), realloc(), and valloc().

G4ThreadLocal double alloctime = 0.0

Definition at line 14 of file hjmalloc.cc.

Referenced by calloc(), malloc(), realloc(), and valloc().

G4ThreadLocal long int freecount = 0

Definition at line 12 of file hjmalloc.cc.

Referenced by cfree(), free(), and realloc().

G4ThreadLocal double freetime = 0.0

Definition at line 15 of file hjmalloc.cc.

Referenced by cfree(), and free().

G4ThreadLocal int mallocswitch = 0

Definition at line 9 of file hjmalloc.cc.

Referenced by calloc(), cfree(), free(), malloc(), realloc(), and valloc().