CONFIG LIB  1.5
Configuration Files Library (by TGG 2020)
MEMFUN Class Reference

class with overloaded "new" operator initializing object with zeros More...

#include <memfun.h>

Inheritance diagram for MEMFUN:
AIRFOIL GRID_ARRAYS NACA_PROFILE

Static Public Member Functions

static void * operator new (size_t st, const char *text="(unknown)", int ierr_print=1)
 Overloaded "new" operator initializing object with zeros. More...
 

Detailed Description

class with overloaded "new" operator initializing object with zeros

Definition at line 33 of file memfun.h.

Member Function Documentation

◆ operator new()

void * MEMFUN::operator new ( size_t  st,
const char *  text = "(unknown)",
int  ierr_print = 1 
)
static

Overloaded "new" operator initializing object with zeros.

Parameters
text- optional comment to be printed to stderr
ierr_print- flag that controls the message printing to stderr (1 - prints, 0 - doesn't print)

Definition at line 23 of file memfun.cpp.

24 {
25  void *pv = ::operator new( st );
26  if( pv )
27  {
28  memset( pv , 0 , st );
29  if( ierr_print )
30  cerr << "MEMFUN: object " << text
31  << " allocated, address: " << pv
32  << " size=" << st << endl;
33  }
34  else
35  {
36  cout << " MEMFUN: object " << text
37  << " is not allocated !!!" << endl;
38  exit( -1 );
39  }
40 
41  return pv;
42 }

The documentation for this class was generated from the following files: