campo-sirio/xi/xiheap.c
alex 18c8e52948 This commit was generated by cvs2svn to compensate for changes in r5757,
which included commits to RCS files with non-trunk default branches.

git-svn-id: svn://10.65.10.50/trunk@5758 c028cbd2-c16b-5b4b-a496-9718f37d4682
1997-12-17 10:43:31 +00:00

58 lines
1.2 KiB
C
Executable File

/*******************************************************************************
* Copyright 1991-1995 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 = malloc(size);
if ( p != NULL )
memset((char *)p, '\0', (size_t)size);
return(p);
}
void
heap_free(void *p)
{
#ifdef DEBUG
nbr_free++;
#endif
free((char *)p);
}
void *
heap_realloc(void *p, size_t size)
{
return( realloc((char *)p, size ));
}
void
heap_dbg(char *title)
{
#ifdef DEBUG
xvt_debug_printf("heap check (%s): malloc's=%u, free's=%u", title, nbr_malloc, nbr_free);
#else
NOREF(title);
#endif
}