which included commits to RCS files with non-trunk default branches. git-svn-id: svn://10.65.10.50/trunk@5762 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			60 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
 | 
						|
/*******************************************************************************
 | 
						|
*  Copyright 1991-1996 by ORCA Software, Inc.                                  *
 | 
						|
*                                                                              *
 | 
						|
*  All rights reserved.  May not be reproduced or distributed, in printed or   *
 | 
						|
*  electronic form, without permission of ORCA Software, Inc.  May not be      *
 | 
						|
*  distributed as object code, separately or linked with other object modules, *
 | 
						|
*  without permission.                                                         *
 | 
						|
*******************************************************************************/
 | 
						|
 | 
						|
#define XI_INTERNAL
 | 
						|
 | 
						|
#include "xi.h"
 | 
						|
#include "xiheap.h"
 | 
						|
 | 
						|
#ifdef DEBUG
 | 
						|
int nbr_malloc,
 | 
						|
nbr_free;
 | 
						|
 | 
						|
#endif
 | 
						|
 | 
						|
void *
 | 
						|
heap_malloc( size_t size )
 | 
						|
{
 | 
						|
  void *p;
 | 
						|
 | 
						|
#ifdef DEBUG
 | 
						|
  nbr_malloc++;
 | 
						|
#endif
 | 
						|
  p = XinMemoryAlloc( size );
 | 
						|
  if ( p != NULL )
 | 
						|
    memset( ( char * ) p, '\0', ( size_t ) size );
 | 
						|
  return ( p );
 | 
						|
}
 | 
						|
 | 
						|
void
 | 
						|
heap_free( void *p )
 | 
						|
{
 | 
						|
#ifdef DEBUG
 | 
						|
  nbr_free++;
 | 
						|
#endif
 | 
						|
  XinMemoryFree( ( char * ) p );
 | 
						|
}
 | 
						|
 | 
						|
void *
 | 
						|
heap_realloc( void *p, size_t size )
 | 
						|
{
 | 
						|
  return ( XinMemoryRealloc( ( char * ) p, size ) );
 | 
						|
}
 | 
						|
 | 
						|
void
 | 
						|
heap_dbg( char *title )
 | 
						|
{
 | 
						|
#ifdef DEBUG
 | 
						|
  XinDebugPrintf( "heap check (%Fs): malloc's=%u, free's=%u", title, nbr_malloc, nbr_free );
 | 
						|
#else
 | 
						|
  NOREF( title );
 | 
						|
#endif
 | 
						|
}
 |