IN2OSM  1.0.1
CrtAllocator

C-runtime library allocator. More...

#include <allocators.h>

Collaboration diagram for CrtAllocator:
Collaboration graph

Public Member Functions

void * Malloc (size_t size)
 
void * Realloc (void *originalPtr, size_t originalSize, size_t newSize)
 

Static Public Member Functions

static void Free (void *ptr)
 

Static Public Attributes

static const bool kNeedFree = true
 

Detailed Description

C-runtime library allocator.

This class is just wrapper for standard C library memory routines.

Note
implements Allocator concept

Definition at line 75 of file allocators.h.

Member Function Documentation

◆ Free()

static void Free ( void *  ptr)
inlinestatic

Definition at line 92 of file allocators.h.

92 { std::free(ptr); }

◆ Malloc()

void* Malloc ( size_t  size)
inline

Definition at line 78 of file allocators.h.

78  {
79  if (size) // behavior of malloc(0) is implementation defined.
80  return std::malloc(size);
81  else
82  return NULL; // standardize to returning NULL.
83  }
Here is the caller graph for this function:

◆ Realloc()

void* Realloc ( void *  originalPtr,
size_t  originalSize,
size_t  newSize 
)
inline

Definition at line 84 of file allocators.h.

84  {
85  (void)originalSize;
86  if (newSize == 0) {
87  std::free(originalPtr);
88  return NULL;
89  }
90  return std::realloc(originalPtr, newSize);
91  }

Member Data Documentation

◆ kNeedFree

const bool kNeedFree = true
static

Definition at line 77 of file allocators.h.


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