home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / incla / malloc.h__ / MALLOC.H
Encoding:
C/C++ Source or Header  |  1992-09-30  |  4.1 KB  |  109 lines

  1. #if ( !defined(__malloc_h) && !defined(__stdlib_h) )
  2.    #define __malloc_h
  3.  
  4.    #pragma info( none )
  5.    #ifndef __CHKHDR__
  6.       #pragma info( none )
  7.    #endif
  8.    #pragma info( restore )
  9.  
  10.    #ifdef __cplusplus
  11.       extern "C" {
  12.    #endif
  13.  
  14.    /********************************************************************/
  15.    /*  <malloc.h> header file                                          */
  16.    /*                                                                  */
  17.    /*  Licensed Materials - Property of IBM                            */
  18.    /*                                                                  */
  19.    /*  IBM C Set/2 Beta Version                                        */
  20.    /*  Copyright (C) International Business Machines Corp., 1991,1992  */
  21.    /*  All rights reserved                                             */
  22.    /*                                                                  */
  23.    /*  US Government Users Restricted Rights -                         */
  24.    /*  Use, duplication, or disclosure restricted                      */
  25.    /*  by GSA ADP Schedule Contract with IBM Corp.                     */
  26.    /*                                                                  */
  27.    /********************************************************************/
  28.  
  29.    #if defined(__EXTENDED__)
  30.  
  31.       #ifndef __size_t
  32.         #define __size_t
  33.         typedef unsigned int size_t;
  34.       #endif
  35.  
  36.       /* Define different memory model versions of memory management routines */
  37.       /* to the standard names.                                               */
  38.  
  39.       #define _ncalloc( x, y )  calloc( (x), (y) )
  40.       #define _fcalloc( x, y )  calloc( (x), (y) )
  41.       #define _nfree( x )       free( (x) )
  42.       #define _ffree( x )       free( (x) )
  43.       #define _nmalloc( x )     malloc( (x) )
  44.       #define _fmalloc( x )     malloc( (x) )
  45.       #define _nrealloc( x, y ) realloc( (x), (y) )
  46.       #define _frealloc( x, y ) realloc( (x), (y) )
  47.       #define _fheapmin( )      _heapmin( )
  48.       #define _nheapmin( )      _heapmin( )
  49.  
  50.       /* function prototypes */
  51.  
  52.       #ifndef _alloca
  53.          void * _Builtin __alloca( size_t );
  54.          #pragma info( none )
  55.          #define _alloca( x ) __alloca( (x) )
  56.          #define alloca( x ) __alloca( (x) )
  57.          #pragma info( restore )
  58.       #endif
  59.  
  60.       void * _Optlink calloc( size_t, size_t );
  61.       void   _Optlink free( void * );
  62.       void * _Optlink malloc( size_t );
  63.       void * _Optlink realloc( void *, size_t );
  64.       int    _Optlink _heapmin(void);
  65.    #ifdef __DEBUG_ALLOC__
  66.       void * _Optlink _debug_calloc( size_t, size_t, const char *, size_t );
  67.       void   _Optlink _debug_free( void *, const char *, size_t );
  68.       void * _Optlink _debug_malloc( size_t, const char *, size_t );
  69.       void * _Optlink _debug_realloc( void *, size_t, const char *, size_t );
  70.       int    _Optlink _debug_heapmin( const char *, size_t );
  71.       void   _Optlink _heap_check( void );
  72.       void   _Optlink _dump_allocated( int );
  73.       #pragma info( none )
  74.       #define calloc( x, y )  _debug_calloc( (x), (y), __FILE__, __LINE__ )
  75.       #define free( x )       _debug_free( (x), __FILE__, __LINE__ )
  76.       #define malloc( x )     _debug_malloc( (x), __FILE__, __LINE__ )
  77.       #define realloc( x, y ) _debug_realloc( (x), (y), __FILE__, __LINE__ )
  78.       #define _heapmin( )     _debug_heapmin( __FILE__, __LINE__ )
  79.       #pragma info( restore )
  80.  
  81.    #endif
  82.  
  83.    #ifdef __TILED__
  84.       void * _Optlink _tcalloc( size_t, size_t );
  85.       void   _Optlink _tfree( void * );
  86.       void * _Optlink _tmalloc( size_t );
  87.       void * _Optlink _trealloc( void *, size_t );
  88.       #pragma info( none )
  89.       #define calloc( x, y )  _tcalloc( (x), (y) )
  90.       #define free( x )       _tfree( (x) )
  91.       #define malloc( x )     _tmalloc( (x) )
  92.       #define realloc( x, y ) _trealloc( (x), (y) )
  93.       #pragma info( restore )
  94.    #endif
  95.  
  96.    #endif
  97.  
  98.    #ifdef __cplusplus
  99.       }
  100.    #endif
  101.  
  102.    #pragma info( none )
  103.    #ifndef __CHKHDR__
  104.       #pragma info( restore )
  105.    #endif
  106.    #pragma info( restore )
  107.  
  108. #endif
  109.