/*static char *SCCSID = "@(#)heap.h	6.2 91/01/14";*/
/*	SCCSID = "@(#)heap.h	6.2 91/01/14"
 *
 *	IBM/Microsoft Confidential
 *
 *	Copyright (c) IBM Corporation 1987, 1989
 *	Copyright (c) Microsoft Corporation 1987, 1989
 *
 *	All Rights Reserved
 *
 */

/*
 *  HEAP.H
 *
 *    DESCRIPTION
 *
 *      Constants and structures for dealing with memory heaps.
 *
 *
 *  REVISION HISTORY (in reverse chronological order)
 *  -----------------------------------------------------------------------
 *  10/30/89    Brian Andrew    Initial versions
 *
 *
 *  TO DO
 *  -------------------------------------------------------------------------
 */



/*
 *  HEAP PHEAP PPHEAP (h, ph, pph)
 *
 *      This is the basic structure for memory allocation.  It consists
 *      of an allocated segment.  The first 4 bytes is a ULONG which
 *      indicates how many bytes are left in this segment.  The next 4
 *      bytes are a FAR pointer to the next heap segment, if it exists.
 *      It is expected that only 1 segment will be needed.
 *
 *          ulHeapSize  =   Bytes remaining in this heap segment.
 *          pNextHeap   =   Pointer to next heap segment (NULL otherwise).
 */

typedef struct HEAP
{
	ULONG           cbHeapSize;
	struct HEAP FAR *phNextHeap;

} HEAP, FAR *PHEAP, FAR * FAR *PPHEAP;


/*
 *  A heap segment starts as a full 64K segment.  If enough bytes are used
 *  so fewer than 8 bytes remain, we will discard those few bytes.
 */

/* MIN_HEAP_SIZE should be changed if BUF_LIST is not the smallest struct */

#define MIN_HEAP_SIZE       sizeof (BUF_LIST)

/* Heaps are allocated in 64K chunks */

#define HEAP_ALLOC          0x10000L

/* Initial heap size is larger */
#define INIT_HEAP_SIZE      0x10000L

