|
|
1.1 ! root 1: /*** ! 2: *malloc.h - declarations and definitions for memory allocation functions ! 3: * ! 4: * Copyright (c) 1985-1987, Microsoft Corporation. All rights reserved. ! 5: * ! 6: *Purpose: ! 7: * Contains the function declarations for memory allocation functions; ! 8: * also defines manifest constants and types used by the heap routines. ! 9: * [System V] ! 10: * ! 11: *******************************************************************************/ ! 12: ! 13: #define _HEAPEMPTY -1 ! 14: #define _HEAPOK -2 ! 15: #define _HEAPBADBEGIN -3 ! 16: #define _HEAPBADNODE -4 ! 17: #define _HEAPEND -5 ! 18: #define _HEAPBADPTR -6 ! 19: #define _FREEENTRY 0 ! 20: #define _USEDENTRY 1 ! 21: ! 22: #ifndef _SIZE_T_DEFINED ! 23: typedef unsigned int size_t; ! 24: #define _SIZE_T_DEFINED ! 25: #endif ! 26: ! 27: #if (!defined(NO_EXT_KEYS)) ! 28: ! 29: #ifndef _HEAPINFO_DEFINED ! 30: typedef struct _heapinfo { ! 31: int far * _pentry; ! 32: size_t _size; ! 33: int _useflag; ! 34: } _HEAPINFO; ! 35: #define _HEAPINFO_DEFINED ! 36: #endif ! 37: ! 38: #else /* NO_EXT_KEYS */ ! 39: #if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM)) ! 40: ! 41: #ifndef _HEAPINFO_DEFINED ! 42: ! 43: typedef struct _heapinfo { ! 44: int * _pentry; ! 45: size_t _size; ! 46: int _useflag; ! 47: } _HEAPINFO; ! 48: ! 49: #define _HEAPINFO_DEFINED ! 50: #endif ! 51: ! 52: #endif /* M_I86CM || M_I86LM || M_I86HM */ ! 53: ! 54: #endif /* NO_EXT_KEYS */ ! 55: ! 56: ! 57: #if (defined(M_I86SM) || defined(M_I86MM)) ! 58: #define _heapchk _nheapchk ! 59: #define _heapset _nheapset ! 60: #define _heapwalk _nheapwalk ! 61: #endif ! 62: #if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM)) ! 63: #define _heapchk _fheapchk ! 64: #define _heapset _fheapset ! 65: #define _heapwalk _fheapwalk ! 66: #endif ! 67: ! 68: #ifndef NO_EXT_KEYS /* extensions enabled */ ! 69: #define _CDECL cdecl ! 70: #define _NEAR near ! 71: #else /* extensions not enabled */ ! 72: #define _CDECL ! 73: #define _NEAR ! 74: #endif /* NO_EXT_KEYS */ ! 75: ! 76: ! 77: /* external variable declarations */ ! 78: ! 79: extern unsigned int _NEAR _CDECL _amblksiz; ! 80: ! 81: ! 82: /* function prototypes */ ! 83: ! 84: void * _CDECL alloca(size_t); ! 85: void * _CDECL calloc(size_t, size_t); ! 86: void * _CDECL _expand(void *, size_t); ! 87: int _CDECL _fheapchk(void); ! 88: int _CDECL _fheapset(unsigned int); ! 89: unsigned int _CDECL _freect(size_t); ! 90: void _CDECL free(void *); ! 91: void * _CDECL malloc(size_t); ! 92: size_t _CDECL _memavl(void); ! 93: size_t _CDECL _memmax(void); ! 94: size_t _CDECL _msize(void *); ! 95: int _CDECL _nheapchk(void); ! 96: int _CDECL _nheapset(unsigned int); ! 97: void * _CDECL realloc(void *, size_t); ! 98: void * _CDECL sbrk(int); ! 99: size_t _CDECL stackavail(void); ! 100: ! 101: ! 102: #ifndef NO_EXT_KEYS /* extensions enabled */ ! 103: ! 104: void cdecl _ffree(void far *); ! 105: void far * cdecl _fmalloc(size_t); ! 106: size_t cdecl _fmsize(void far *); ! 107: #ifndef _QC ! 108: void huge * cdecl halloc(long, size_t); ! 109: void cdecl hfree(void huge *); ! 110: #endif ! 111: void cdecl _nfree(void near *); ! 112: void near * cdecl _nmalloc(size_t); ! 113: size_t cdecl _nmsize(void near *); ! 114: int cdecl _nheapwalk(struct _heapinfo *); ! 115: int cdecl _fheapwalk(struct _heapinfo *); ! 116: ! 117: #else ! 118: #if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM)) ! 119: ! 120: int _nheapwalk(struct _heapinfo *); ! 121: int _fheapwalk(struct _heapinfo *); ! 122: ! 123: #endif /* M_I86CM || M_I86LM || M_I86HM */ ! 124: ! 125: #endif /* NO_EXT_KEYS */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.