/* * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved. * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * * Permission is hereby granted to use or copy this program * for any purpose, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice.
*/ # include "private/gc_priv.h"
# ifdef PCR /* * We wrap all of the allocator functions to avoid questions of * compatibility between the prototyped and nonprototyped versions of the f
*/ # include "config/PCR_StdTypes.h" # include "mm/PCR_MM.h" # include <errno.h>
# define MY_MAGIC 17L # define MY_DEBUGMAGIC 42L
void * GC_AllocProc(size_t size, PCR_Bool ptrFree, PCR_Bool clear )
{ if (ptrFree) { void * result = (void *)GC_malloc_atomic(size); if (clear && result != 0) BZERO(result, size); return(result);
} else { return((void *)GC_malloc(size));
}
}
void * GC_DebugAllocProc(size_t size, PCR_Bool ptrFree, PCR_Bool clear )
{ if (ptrFree) { void * result = (void *)GC_debug_malloc_atomic(size, __FILE__,
__LINE__); if (clear && result != 0) BZERO(result, size); return(result);
} else { return((void *)GC_debug_malloc(size, __FILE__, __LINE__));
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.