1baa3858d3f5d128a5c8466b700098109edcad5f2repo sync/* Alloc.h -- Memory allocation functions
2baa3858d3f5d128a5c8466b700098109edcad5f2repo sync2009-02-07 : Igor Pavlov : Public domain */
3baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
4baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#ifndef __COMMON_ALLOC_H
5baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#define __COMMON_ALLOC_H
6baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
7baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#include <stddef.h>
8baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
9baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#ifdef __cplusplus
10baa3858d3f5d128a5c8466b700098109edcad5f2repo syncextern "C" {
11baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#endif
12baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
13baa3858d3f5d128a5c8466b700098109edcad5f2repo syncvoid *MyAlloc(size_t size);
14baa3858d3f5d128a5c8466b700098109edcad5f2repo syncvoid MyFree(void *address);
15baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
16baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#ifdef _WIN32
17baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
18baa3858d3f5d128a5c8466b700098109edcad5f2repo syncvoid SetLargePageSize();
19baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
20baa3858d3f5d128a5c8466b700098109edcad5f2repo syncvoid *MidAlloc(size_t size);
21baa3858d3f5d128a5c8466b700098109edcad5f2repo syncvoid MidFree(void *address);
22baa3858d3f5d128a5c8466b700098109edcad5f2repo syncvoid *BigAlloc(size_t size);
23baa3858d3f5d128a5c8466b700098109edcad5f2repo syncvoid BigFree(void *address);
24baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
25baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#else
26baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
27baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#define MidAlloc(size) MyAlloc(size)
28baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#define MidFree(address) MyFree(address)
29baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#define BigAlloc(size) MyAlloc(size)
30baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#define BigFree(address) MyFree(address)
31baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
32baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#endif
33baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
34baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#ifdef __cplusplus
35baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
36baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#endif
37baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
38baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#endif
39