1 /* 2 * malloc.h 3 * 4 * Support for programs which want to use malloc.h to get memory management 5 * functions. Unless you absolutely need some of these functions and they are 6 * not in the ANSI headers you should use the ANSI standard header files 7 * instead. 8 * 9 * This file is part of the Mingw32 package. 10 * 11 * Contributors: 12 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> 13 * 14 * THIS SOFTWARE IS NOT COPYRIGHTED 15 * 16 * This source code is offered for use in the public domain. You may 17 * use, modify or distribute it freely. 18 * 19 * This code is distributed in the hope that it will be useful but 20 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 21 * DISCLAIMED. This includes but is not limited to warranties of 22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 23 * 24 * $Revision: 1.2 $ 25 * $Author: bellard $ 26 * $Date: 2005/04/17 13:14:29 $ 27 * 28 */ 29 30 #ifndef __STRICT_ANSI__ 31 32 #ifndef _MALLOC_H_ 33 #define _MALLOC_H_ 34 35 /* All the headers include this file. */ 36 #include <_mingw.h> 37 38 #include <stdlib.h> 39 40 #ifndef RC_INVOKED 41 42 /* 43 * The structure used to walk through the heap with _heapwalk. 44 */ 45 typedef struct _heapinfo 46 { 47 int* _pentry; 48 size_t _size; 49 int _useflag; 50 } _HEAPINFO; 51 52 /* Values for _heapinfo.useflag */ 53 #define _USEDENTRY 0 54 #define _FREEENTRY 1 55 56 #ifdef __cplusplus 57 extern "C" { 58 #endif 59 /* 60 The _heap* memory allocation functions are supported on NT 61 but not W9x. On latter, they always set errno to ENOSYS. 62 */ 63 int _heapwalk (_HEAPINFO*); 64 65 #ifndef _NO_OLDNAMES 66 int heapwalk (_HEAPINFO*); 67 #endif /* Not _NO_OLDNAMES */ 68 69 int _heapchk (void); /* Verify heap integrety. */ 70 int _heapmin (void); /* Return unused heap to the OS. */ 71 int _heapset (unsigned int); 72 73 size_t _msize (void*); 74 size_t _get_sbh_threshold (void); 75 int _set_sbh_threshold (size_t); 76 void * _expand (void*, size_t); 77 78 #ifdef __cplusplus 79 } 80 #endif 81 82 #endif /* RC_INVOKED */ 83 84 #endif /* Not _MALLOC_H_ */ 85 86 #endif /* Not __STRICT_ANSI__ */ 87 88