GOG GALAXY SDK Documentation
GalaxyAllocator.h
Go to the documentation of this file.
1 #ifndef GALAXY_I_ALLOCATOR_H
2 #define GALAXY_I_ALLOCATOR_H
3 
9 #include "stdint.h"
10 #include <cstddef>
11 
12 namespace galaxy
13 {
14  namespace api
15  {
28  typedef void* (*GalaxyMalloc)(uint32_t size, const char* typeName);
29 
38  typedef void* (*GalaxyRealloc)(void* ptr, uint32_t newSize, const char* typeName);
39 
45  typedef void (*GalaxyFree)(void* ptr);
46 
51  {
56  : galaxyMalloc(NULL)
57  , galaxyRealloc(NULL)
58  , galaxyFree(NULL)
59  {}
60 
68  GalaxyAllocator(GalaxyMalloc _galaxyMalloc, GalaxyRealloc _galaxyRealloc, GalaxyFree _galaxyFree)
69  : galaxyMalloc(_galaxyMalloc)
70  , galaxyRealloc(_galaxyRealloc)
71  , galaxyFree(_galaxyFree)
72  {}
73 
77  };
78 
80  }
81 }
82 
83 #endif
void(* GalaxyFree)(void *ptr)
Free function.
Definition: GalaxyAllocator.h:45
void *(* GalaxyRealloc)(void *ptr, uint32_t newSize, const char *typeName)
Reallocate function.
Definition: GalaxyAllocator.h:38
void *(* GalaxyMalloc)(uint32_t size, const char *typeName)
Allocate function.
Definition: GalaxyAllocator.h:28
Custom memory allocator for GOG Galaxy SDK.
Definition: GalaxyAllocator.h:51
GalaxyAllocator()
GalaxyAllocator default constructor.
Definition: GalaxyAllocator.h:55
GalaxyMalloc galaxyMalloc
Allocation function.
Definition: GalaxyAllocator.h:74
GalaxyRealloc galaxyRealloc
Reallocation function.
Definition: GalaxyAllocator.h:75
GalaxyAllocator(GalaxyMalloc _galaxyMalloc, GalaxyRealloc _galaxyRealloc, GalaxyFree _galaxyFree)
GalaxyAllocator constructor.
Definition: GalaxyAllocator.h:68
GalaxyFree galaxyFree
Free function.
Definition: GalaxyAllocator.h:76