home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 14 / hacker14.iso / programacao / cwin / c.exe / $INSTDIR / include / malloc.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-12-15  |  2.0 KB  |  94 lines

  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.8 $
  25.  * $Author: earnie $
  26.  * $Date: 2002/12/20 13:35:27 $
  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. #ifdef __GNUC__
  65. #define _alloca(x) __builtin_alloca((x))
  66. #endif
  67.  
  68. #ifndef    _NO_OLDNAMES
  69. int    heapwalk (_HEAPINFO*);
  70. #ifdef __GNUC__
  71. #define alloca(x) __builtin_alloca((x))
  72. #endif
  73. #endif    /* Not _NO_OLDNAMES */
  74.  
  75. int    _heapchk (void);    /* Verify heap integrety. */
  76. int    _heapmin (void);    /* Return unused heap to the OS. */
  77. int    _heapset (unsigned int);
  78.  
  79. size_t    _msize (void*);
  80. size_t    _get_sbh_threshold (void); 
  81. int    _set_sbh_threshold (size_t);
  82. void *    _expand (void*, size_t); 
  83.  
  84. #ifdef __cplusplus
  85. }
  86. #endif
  87.  
  88. #endif    /* RC_INVOKED */
  89.  
  90. #endif /* Not _MALLOC_H_ */
  91.  
  92. #endif /* Not __STRICT_ANSI__ */
  93.  
  94.