campo-sirio/xi/xiheap.c
alex ebabab8c26 This commit was generated by cvs2svn to compensate for changes in r5761,
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
1997-12-17 12:57:49 +00:00

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
}