malloc.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 <[email protected]>
  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. #ifndef __STRICT_ANSI__
  30. #ifndef _MALLOC_H_
  31. #define _MALLOC_H_
  32. /* All the headers include this file. */
  33. #include <_mingw.h>
  34. #include <stdlib.h>
  35. #ifndef RC_INVOKED
  36. /*
  37. * The structure used to walk through the heap with _heapwalk.
  38. */
  39. typedef struct _heapinfo
  40. {
  41. int* _pentry;
  42. size_t _size;
  43. int _useflag;
  44. } _HEAPINFO;
  45. /* Values for _heapinfo.useflag */
  46. #define _USEDENTRY 0
  47. #define _FREEENTRY 1
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51. /*
  52. The _heap* memory allocation functions are supported on NT
  53. but not W9x. On latter, they always set errno to ENOSYS.
  54. */
  55. int _heapwalk (_HEAPINFO*);
  56. #ifndef _NO_OLDNAMES
  57. int heapwalk (_HEAPINFO*);
  58. #endif /* Not _NO_OLDNAMES */
  59. int _heapchk (void); /* Verify heap integrety. */
  60. int _heapmin (void); /* Return unused heap to the OS. */
  61. int _heapset (unsigned int);
  62. size_t _msize (void*);
  63. size_t _get_sbh_threshold (void);
  64. int _set_sbh_threshold (size_t);
  65. void * _expand (void*, size_t);
  66. #ifdef __cplusplus
  67. }
  68. #endif
  69. #endif /* RC_INVOKED */
  70. #endif /* Not _MALLOC_H_ */
  71. #endif /* Not __STRICT_ANSI__ */