CMS 3D CMS Logo

Macros | Functions
Alloc.h File Reference
#include <cstddef>

Go to the source code of this file.

Macros

#define BigAlloc(size)   MyAlloc(size)
 
#define BigFree(address)   MyFree(address)
 
#define MidAlloc(size)   MyAlloc(size)
 
#define MidFree(address)   MyFree(address)
 

Functions

void * MyAlloc (size_t size)
 
void MyFree (void *address)
 

Macro Definition Documentation

◆ BigAlloc

#define BigAlloc (   size)    MyAlloc(size)

Definition at line 29 of file Alloc.h.

◆ BigFree

#define BigFree (   address)    MyFree(address)

Definition at line 30 of file Alloc.h.

◆ MidAlloc

#define MidAlloc (   size)    MyAlloc(size)

Definition at line 27 of file Alloc.h.

◆ MidFree

#define MidFree (   address)    MyFree(address)

Definition at line 28 of file Alloc.h.

Function Documentation

◆ MyAlloc()

void* MyAlloc ( size_t  size)

Definition at line 23 of file Alloc.cc.

23  {
24  if (size == 0)
25  return nullptr;
26 #ifdef _SZ_ALLOC_DEBUG
27  {
28  void *p = malloc(size);
29  fprintf(stderr, "\nAlloc %10d bytes, count = %10d, addr = %8X", size, g_allocCount++, (unsigned)p);
30  return p;
31  }
32 #else
33  return malloc(size);
34 #endif
35 }

References AlCaHLTBitMon_ParallelJobs::p, findQualityFiles::size, and submitPVResolutionJobs::stderr.

Referenced by SzAlloc().

◆ MyFree()

void MyFree ( void *  address)

Definition at line 37 of file Alloc.cc.

37  {
38 #ifdef _SZ_ALLOC_DEBUG
39  if (address != 0)
40  fprintf(stderr, "\nFree; count = %10d, addr = %8X", --g_allocCount, (unsigned)address);
41 #endif
42  free(address);
43 }

References submitPVResolutionJobs::stderr.

Referenced by SzFree().

submitPVResolutionJobs.stderr
stderr
Definition: submitPVResolutionJobs.py:45
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443