_heap.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:2k
- /*
- * Paradigm C/C++ Run-Time Library - Version 5.0
- *
- * Copyright (c) 1998 Paradigm Systems. All rights reserved.
- * Portions Copyright (c) 1996 Borland International.
- *
- * $Revision: 2 $
- *
- * Near heap variables and functions
- */
- #include "Config.h" // Global Configuration - do not remove!
- #include "IncludeSysdefs.h"
- #define MARGIN 512
- /* Near Heap Variables */
- extern unsigned _heapbase;
- struct POOL
- {
- unsigned int head;
- unsigned int first;
- unsigned int last;
- unsigned int rover;
- unsigned int brklvl;
- unsigned int heaplimit;
- };
- /* Near Heap Functions */
- extern struct POOL _mempool[];
- typedef enum{
- DEFAULT_HEAP = 0,
- UI_MEMPOOL,
- MAX_POOLNUM,
- }POOL_ID;
- #ifndef _SIZE_T
- #define _SIZE_T
- typedef unsigned size_t;
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- void *cdecl malloc(size_t __nbytes);
- void cdecl free(void _FAR *__ap);
- void *cdecl realloc(void _FAR *__ptr, size_t __size);
- void *cdecl _clib_malloc(size_t __nbytes);
- void cdecl _clib_free(void _FAR *__ap);
- void *cdecl _clib_realloc(void _FAR *__ptr, size_t __size);
- #if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
- unsigned long cdecl coreleft(void);
- unsigned long cdecl _clib_coreleft(void);
- #else
- unsigned cdecl coreleft(void);
- unsigned cdecl _clib_coreleft(void);
- #endif
- int cdecl _clib_heapcheck(void);
- int cdecl _clib_heapfillfree(unsigned int __fillvalue);
- int cdecl _clib_heapcheckfree(unsigned int __fillvalue);
- int cdecl _clib_heapchecknode(void *__node);
- int cdecl _clib_heapwalk(struct heapinfo *__hi);
- int cdecl near __brk(void *__addr);
- void *cdecl near __sbrk(long __incr);
- #ifdef D_SUPPORT_MEM_POOL
- void *MEM_Allocate(int pool_id, size_t size);
- void MEM_Free(int pool_id, void *__block);
- void MEM_PoolConstruct(int pool_id, unsigned char *__ptr, int __size);
- BOOL MEM_PoolDestruct(int pool_id);
- BOOL MEM_PoolResize(int pool_id, int __size);
- #endif
- #ifdef __cplusplus
- }
- #endif