completed porting forward the chunks and base layers of the heap management code

This commit is contained in:
Eric J. Bowersox
2013-06-09 19:50:14 -06:00
parent 0f309bbbc0
commit f1950fa933
11 changed files with 964 additions and 23 deletions

View File

@@ -50,7 +50,8 @@ typedef struct tagRAWHEAPDATA
UINT32 opaque[32]; /* opaque data, do not modify */
} RAWHEAPDATA, *PRAWHEAPDATA;
typedef void (*PFNRAWHEAPDATAFREE)(PRAWHEAPDATA prhd); /* function that optionally frees the heap data */
typedef void (*PFNRAWHEAPDATAFREE)(PRAWHEAPDATA); /* function that optionally frees the heap data */
typedef void (*PFNHEAPABORT)(PVOID); /* function called to abort on serious error */
/*--------------------
* External functions
@@ -61,8 +62,9 @@ typedef void (*PFNRAWHEAPDATAFREE)(PRAWHEAPDATA prhd); /* function that optional
CDECL_BEGIN
extern HRESULT HeapCreate(PRAWHEAPDATA prhd, PFNRAWHEAPDATAFREE pfnFree, IChunkAllocator *pChunkAllocator,
IMutexFactory *pMutexFactory, UINT32 nChunkBits, IMalloc **ppHeap);
extern HRESULT HeapCreate(PRAWHEAPDATA prhd, PFNRAWHEAPDATAFREE pfnFree, PFNHEAPABORT pfnAbort, PVOID pvAbortArg,
IChunkAllocator *pChunkAllocator, IMutexFactory *pMutexFactory, UINT32 nChunkBits,
IMalloc **ppHeap);
CDECL_END

View File

@@ -49,6 +49,7 @@ typedef struct tagLDIV {
CDECL_BEGIN
extern HRESULT IntLDiv(PLDIV pResult, INT64 num, INT64 denom);
extern INT32 IntFirstSet(INT32 nMask);
CDECL_END

View File

@@ -59,6 +59,10 @@
#define INT64_BITS 64
#define UINT64_BITS 64
#define LOG_PTRSIZE 2 /* log2(sizeof(void *)) */
#define LOG_INTSIZE 2 /* log2(sizeof(int)) */
#define LOG_INT64SIZE 3 /* log2(sizeof(long long)) */
/* Boolean values */
#define TRUE 1
#define FALSE 0