home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dbmalloc.zip / dgmalloc.c < prev    next >
C/C++ Source or Header  |  1993-01-04  |  3KB  |  138 lines

  1.  
  2. /*
  3.  * (c) Copyright 1990, 1991, 1992 Conor P. Cahill (cpcahil@virtech.vti.com)
  4.  *
  5.  * This software may be distributed freely as long as the following conditions
  6.  * are met:
  7.  *         * the distribution, or any derivative thereof, may not be
  8.  *          included as part of a commercial product
  9.  *        * full source code is provided including this copyright
  10.  *        * there is no charge for the software itself (there may be
  11.  *          a minimal charge for the copying or distribution effort)
  12.  *        * this copyright notice is not modified or removed from any
  13.  *          source file
  14.  */
  15. /*
  16.  * Author(s):
  17.  *  pds - Paul D. Smith (paul_smith@dg.com)
  18.  */
  19. /*
  20.  * This module defines several libc internal interfaces to the allocation
  21.  * and/or memory routines under DG/UX.
  22.  */
  23.  
  24. /*
  25.  * Added "_" components to make sure that libc versions of other
  26.  * malloc interfaces called by various libc routines (eg. getcwd) that
  27.  * must be used from libc do not have competing malloc implementations.
  28.  */
  29. #include <stdio.h>
  30. #include "mallocin.h"
  31.  
  32. DATATYPE *
  33. _malloc(size)
  34.     SIZETYPE size;
  35. {
  36.     return( debug_malloc(NULL,-1,size) );
  37. }
  38.  
  39. DATATYPE *
  40. _realloc(cptr,size)
  41.     DATATYPE  * cptr;
  42.     SIZETYPE    size;
  43. {
  44.     return( debug_realloc(NULL,-1,cptr,size) );
  45. }
  46.  
  47. DATATYPE *
  48. _calloc(nelem,elsize)
  49.     SIZETYPE       nelem;
  50.     SIZETYPE       elsize;
  51. {
  52.     return( debug_calloc(NULL,-1,nelem,elsize) );
  53. }
  54.  
  55. void
  56. _free(cptr)
  57.     DATATYPE    * cptr;
  58. {
  59.     debug_free(NULL,0,cptr);
  60. }
  61.  
  62. int
  63. _mallopt(cmd,value)
  64.     int                    cmd;
  65.     union dbmalloptarg    value;
  66. {
  67.     return( dbmallopt(cmd,&value) );
  68. }
  69.  
  70. MEMDATA  *
  71. _bcopy(ptr2, ptr1, len)
  72.     CONST MEMDATA    * ptr2;
  73.     MEMDATA        * ptr1;
  74.     MEMSIZE          len;
  75. {
  76.     return( DBbcopy((char *)NULL,0,ptr2,ptr1,len) );
  77. }
  78.  
  79. MEMDATA  *
  80. _bzero(ptr1, len)
  81.     MEMDATA        * ptr1;
  82.     MEMSIZE          len;
  83. {
  84.     return( DBbzero((char *)NULL,0,ptr1,len) );
  85. }
  86.  
  87. int
  88. _bcmp(ptr2, ptr1, len)
  89.     CONST MEMDATA    * ptr1;
  90.     CONST MEMDATA    * ptr2;
  91.     MEMSIZE          len;
  92. {
  93.     return( DBbcmp((char *)NULL,0,ptr2, ptr1, len) );
  94. }
  95.  
  96. MEMDATA  *
  97. __dg_bcopy(ptr2, ptr1, len)
  98.     CONST MEMDATA    * ptr2;
  99.     MEMDATA        * ptr1;
  100.     MEMSIZE          len;
  101. {
  102.     return( DBbcopy((char *)NULL,0,ptr2,ptr1,len) );
  103. }
  104.  
  105. MEMDATA  *
  106. __dg_bzero(ptr1, len)
  107.     MEMDATA        * ptr1;
  108.     MEMSIZE          len;
  109. {
  110.     return( DBbzero((char *)NULL,0,ptr1,len) );
  111. }
  112.  
  113. int
  114. __dg_bcmp(ptr2, ptr1, len)
  115.     CONST MEMDATA    * ptr1;
  116.     CONST MEMDATA    * ptr2;
  117.     MEMSIZE          len;
  118. {
  119.     return( DBbcmp((char *)NULL,0,ptr2, ptr1, len) );
  120. }
  121.  
  122.  
  123. /*
  124.  * $Log: dgmalloc.c,v $
  125.  * Revision 1.4  1992/08/22  16:27:13  cpcahil
  126.  * final changes for pl14
  127.  *
  128.  * Revision 1.3  1992/07/03  00:03:25  cpcahil
  129.  * more fixes for pl13, several suggestons from Rich Salz.
  130.  *
  131.  * Revision 1.2  1992/07/02  15:35:52  cpcahil
  132.  * misc cleanups for PL13
  133.  *
  134.  * Revision 1.1  1992/05/06  04:53:29  cpcahil
  135.  * performance enhancments
  136.  *
  137.  */
  138.