TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CrtAllocator Class Reference

C-runtime library allocator. More...

#include <allocators.h>

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

Member Function Documentation

static void CrtAllocator::Free ( void *  ptr)
inlinestatic
79 { std::free(ptr); }
void* CrtAllocator::Malloc ( size_t  size)
inline
65  {
66  if (size) // behavior of malloc(0) is implementation defined.
67  return std::malloc(size);
68  else
69  return NULL; // standardize to returning NULL.
70  }
arena_t NULL
Definition: jemalloc_internal.h:624
void* CrtAllocator::Realloc ( void *  originalPtr,
size_t  originalSize,
size_t  newSize 
)
inline
71  {
72  (void)originalSize;
73  if (newSize == 0) {
74  std::free(originalPtr);
75  return NULL;
76  }
77  return std::realloc(originalPtr, newSize);
78  }
arena_t NULL
Definition: jemalloc_internal.h:624

Member Data Documentation

const bool CrtAllocator::kNeedFree = true
static

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