/* Copyright (c) 1993 Xerox Corporation. All rights reserved. */ /* $Id$ $Date$ * * PCR Memory Management public interface */ /* Chauser, October 28, 1993 4:22 pm PDT */ #ifndef __PCR_MM_h #define __PCR_MM_h 1 #include #include /* * A simple memory manager interface * * Implementations are expected to use the POSIX system-provided * malloc/calloc to allocate their own heap space. * * Clients (wizards excepted) are expected *never* to use * malloc/calloc/realloc/free directly. */ extern void * PCR_MM_Alloc( size_t size, PCR_Bool ptrFree, PCR_Bool clear ); /* Allocate memory. The ptrFree flag is a hint that says it's okay for a GC to not trace through the object. The clear argument causes the allocated area to be initialized to zeroes. */ extern void * PCR_MM_Realloc( void *p, size_t size ); /* Grow / shrink object p, as in the standard C library routine. The ptrFree property is preserved. */ extern void PCR_MM_Free( void *p ); /* Explicit free. */ /* * C clients may use the following sugared names: */ extern void * (PCR_MM_New(size_t size)); # define PCR_MM__New(sz) PCR_MM_Alloc((sz), PCR_Bool_false, PCR_Bool_true) # define PCR_MM_New PCR_MM__New extern void * (PCR_MM_Malloc(size_t size)); # define PCR_MM__Malloc(sz) PCR_MM_Alloc((sz), PCR_Bool_false, PCR_Bool_false) # define PCR_MM_Malloc PCR_MM__Malloc #endif /* ! __PCR_MM_h */ /* $Log$ */