/*static char *SCCSID = "@(#)pr_heap.h	6.2 92/01/31";*/
#if defined(PERFVIEW) && !defined(PVWDEF)
#include <pvwxport.h>
#include "pvw.h"
#endif
#include "PR_HEAP.NAM"
/* Prototypes for all HEAP\ functions */


#ifdef DEBUGHEAP
    /* NOTE SCRUBPATTERN is a hard constant in aghs.asm!! */

#define SCRUBPATTERN 0xa5

void far ScrubHeap (PVOID fpv);

#define SCRUBHEAP(pv) ScrubHeap(pv)
#else
#define SCRUBHEAP(pv)
#endif



#ifdef PERFVIEW
#define DO_PVW_RETHEAP(pv)					\
		/* Decrement Number of objects */		\
		/* and total object size       */		\
		PVWADD(Hp,ObjCnt,-1L);			    \
		PVWADD(Hp,Alloc,((ULONG)(-((long)SIZEHEAPOBJ(pv)))));
#else
#define DO_PVW_RETHEAP(pv)
#endif




#ifdef DEBUG
void far Reachable (VOID far *fpv);
#define REACHABLE(fpv)	  Reachable(fpv)

#define RetHeap(pv) {				    \
		REACHABLE (pv);			    \
		DO_PVW_RETHEAP(pv);		    \
		MAKETYPE ((pv), PUSHORT)[-1] |= 1;  \
		SCRUBHEAP (pv);			    \
	}
#else
#define REACHABLE(fpv)

#define RetHeap(pv) {				    \
		DO_PVW_RETHEAP(pv);		    \
		MAKETYPE ((pv), PUSHORT)[-1] |= 1;  \
	}
#endif


	extern void far HeapInit (PFRAME pfrm);

	extern PVOID GHS (USHORT cch, PFRAME pfrm);

	extern SEL far addheapseg (PFRAME pfrm);

#include "PR_HEAP.SEG"
