-
Notifications
You must be signed in to change notification settings - Fork 71
/
sqWin32Alloc.h
32 lines (25 loc) · 1.08 KB
/
sqWin32Alloc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef __SQ_WIN32_ALLOC_H
#define __SQ_WIN32_ALLOC_H
#ifndef NO_VIRTUAL_MEMORY
#include "sqMemoryAccess.h"
/*
Limit the default size for virtual memory to 512MB to avoid nasty
spurious problems when large dynamic libraries are loaded later.
Applications needing more virtual memory can increase the size by
defining it appropriately - here we try to cater for the common
case by using a "reasonable" size that will leave enough space for
other libraries.
*/
#ifndef MAX_VIRTUAL_MEMORY
#define MAX_VIRTUAL_MEMORY 512*1024*1024
#endif
/* Memory initialize-release */
#undef sqAllocateMemory
#undef sqMemoryExtraBytesLeft
extern usqInt sqAllocateMemory(usqInt minHeapSize, usqInt desiredHeapSize, usqInt baseAddress);
extern void* allocateJITMemory(usqInt desiredSize, usqInt desiredPosition);
#define allocateMemoryMinimumImageFileHeaderSizeBaseAddress(heapSize, minimumMemory, fileStream, headerSize, baseAddress) \
sqAllocateMemory(minimumMemory, heapSize, baseAddress)
int sqMemoryExtraBytesLeft(int includingSwap);
#endif /* NO_VIRTUAL_MEMORY */
#endif /* __SQ_WIN32_ALLOC_H */