diff options
| author | 2024-04-25 21:24:10 +0100 | |
|---|---|---|
| committer | 2024-04-25 22:32:27 +0000 | |
| commit | 2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch) | |
| tree | 80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/TOOLS/BLD/INC/MALLOC.H | |
| parent | Merge pull request #430 from jpbaltazar/typoptbr (diff) | |
| download | ms-dos-main.tar.gz ms-dos-main.tar.xz ms-dos-main.zip | |
Diffstat (limited to 'v4.0/src/TOOLS/BLD/INC/MALLOC.H')
| -rw-r--r-- | v4.0/src/TOOLS/BLD/INC/MALLOC.H | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/v4.0/src/TOOLS/BLD/INC/MALLOC.H b/v4.0/src/TOOLS/BLD/INC/MALLOC.H new file mode 100644 index 0000000..e2aa979 --- /dev/null +++ b/v4.0/src/TOOLS/BLD/INC/MALLOC.H | |||
| @@ -0,0 +1,124 @@ | |||
| 1 | /*** | ||
| 2 | *malloc.h - declarations and definitions for memory allocation functions | ||
| 3 | * | ||
| 4 | * Copyright (c) 1985-1988, 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 | |||
| 14 | #define _HEAPEMPTY -1 | ||
| 15 | #define _HEAPOK -2 | ||
| 16 | #define _HEAPBADBEGIN -3 | ||
| 17 | #define _HEAPBADNODE -4 | ||
| 18 | #define _HEAPEND -5 | ||
| 19 | #define _HEAPBADPTR -6 | ||
| 20 | #define _FREEENTRY 0 | ||
| 21 | #define _USEDENTRY 1 | ||
| 22 | |||
| 23 | #ifndef _SIZE_T_DEFINED | ||
| 24 | typedef unsigned int size_t; | ||
| 25 | #define _SIZE_T_DEFINED | ||
| 26 | #endif | ||
| 27 | |||
| 28 | #if (!defined(NO_EXT_KEYS)) | ||
| 29 | |||
| 30 | #ifndef _HEAPINFO_DEFINED | ||
| 31 | typedef struct _heapinfo { | ||
| 32 | int far * _pentry; | ||
| 33 | size_t _size; | ||
| 34 | int _useflag; | ||
| 35 | } _HEAPINFO; | ||
| 36 | #define _HEAPINFO_DEFINED | ||
| 37 | #endif | ||
| 38 | |||
| 39 | #else /* NO_EXT_KEYS */ | ||
| 40 | #if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM)) | ||
| 41 | |||
| 42 | #ifndef _HEAPINFO_DEFINED | ||
| 43 | |||
| 44 | typedef struct _heapinfo { | ||
| 45 | int * _pentry; | ||
| 46 | size_t _size; | ||
| 47 | int _useflag; | ||
| 48 | } _HEAPINFO; | ||
| 49 | |||
| 50 | #define _HEAPINFO_DEFINED | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #endif /* M_I86CM || M_I86LM || M_I86HM */ | ||
| 54 | |||
| 55 | #endif /* NO_EXT_KEYS */ | ||
| 56 | |||
| 57 | |||
| 58 | #if (defined(M_I86SM) || defined(M_I86MM)) | ||
| 59 | #define _heapchk _nheapchk | ||
| 60 | #define _heapset _nheapset | ||
| 61 | #define _heapwalk _nheapwalk | ||
| 62 | #endif | ||
| 63 | #if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM)) | ||
| 64 | #define _heapchk _fheapchk | ||
| 65 | #define _heapset _fheapset | ||
| 66 | #define _heapwalk _fheapwalk | ||
| 67 | #endif | ||
| 68 | |||
| 69 | #ifndef NO_EXT_KEYS /* extensions enabled */ | ||
| 70 | #define _CDECL cdecl | ||
| 71 | #define _NEAR near | ||
| 72 | #else /* extensions not enabled */ | ||
| 73 | #define _CDECL | ||
| 74 | #define _NEAR | ||
| 75 | #endif /* NO_EXT_KEYS */ | ||
| 76 | |||
| 77 | |||
| 78 | /* external variable declarations */ | ||
| 79 | extern unsigned int _NEAR _CDECL _amblksiz; | ||
| 80 | |||
| 81 | /* function prototypes */ | ||
| 82 | |||
| 83 | void * _CDECL alloca(size_t); | ||
| 84 | void * _CDECL calloc(size_t, size_t); | ||
| 85 | void * _CDECL _expand(void *, size_t); | ||
| 86 | int _CDECL _fheapchk(void); | ||
| 87 | int _CDECL _fheapset(unsigned int); | ||
| 88 | unsigned int _CDECL _freect(size_t); | ||
| 89 | void _CDECL free(void *); | ||
| 90 | void * _CDECL malloc(size_t); | ||
| 91 | size_t _CDECL _memavl(void); | ||
| 92 | size_t _CDECL _memmax(void); | ||
| 93 | size_t _CDECL _msize(void *); | ||
| 94 | int _CDECL _nheapchk(void); | ||
| 95 | int _CDECL _nheapset(unsigned int); | ||
| 96 | void * _CDECL realloc(void *, size_t); | ||
| 97 | void * _CDECL sbrk(int); | ||
| 98 | size_t _CDECL stackavail(void); | ||
| 99 | |||
| 100 | |||
| 101 | #ifndef NO_EXT_KEYS /* extensions enabled */ | ||
| 102 | |||
| 103 | void cdecl _ffree(void far *); | ||
| 104 | void far * cdecl _fmalloc(size_t); | ||
| 105 | size_t cdecl _fmsize(void far *); | ||
| 106 | #ifndef _QC | ||
| 107 | void huge * cdecl halloc(long, size_t); | ||
| 108 | void cdecl hfree(void huge *); | ||
| 109 | #endif | ||
| 110 | void cdecl _nfree(void near *); | ||
| 111 | void near * cdecl _nmalloc(size_t); | ||
| 112 | size_t cdecl _nmsize(void near *); | ||
| 113 | int cdecl _nheapwalk(struct _heapinfo *); | ||
| 114 | int cdecl _fheapwalk(struct _heapinfo *); | ||
| 115 | |||
| 116 | #else | ||
| 117 | #if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM)) | ||
| 118 | |||
| 119 | int _nheapwalk(struct _heapinfo *); | ||
| 120 | int _fheapwalk(struct _heapinfo *); | ||
| 121 | |||
| 122 | #endif /* M_I86CM || M_I86LM || M_I86HM */ | ||
| 123 | |||
| 124 | #endif /* NO_EXT_KEYS */ | ||