/*
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 <config/PCR←StdDefs.h>
#include <stddef.h>

/*
 * 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$
*/