[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
*-------------------------------------------------------------------------
* alloc.hdr -- FORCE's internal memory allocation
*-------------------------------------------------------------------------
#ifndef ALLOC_HDR
#define ALLOC_HDR
*-------------------------------------------------------------------------
* RCSid = "$Header: alloc.hdr 0.10 1992/04/03 19:52:32"
*-------------------------------------------------------------------------
* Prototypes for the FORCE internal memory allocation routines.
*-------------------------------------------------------------------------
FUNCTION LONG malloc PROTOTYPE
PARAMETERS VALUE UINT mem_size && Number of bytes to allocate
FUNCTION LONG calloc PROTOTYPE
PARAMETERS VALUE UINT nelem, ; && Number of elements
VALUE UINT elem_size && Size in bytes of each element
PROCEDURE free PROTOTYPE
PARAMETERS VALUE LONG ptr && Pointer to free
FUNCTION UINT stackavail PROTOTYPE && Amount of stack available
*-------------------------------------------------------------------------
* Prototypes for the Alloc library's memory allocation routines.
*-------------------------------------------------------------------------
FUNCTION LONG alloc PROTOTYPE
PARAMETERS VALUE UINT mem_size && a malloc() that checks free mem.
FUNCTION LONG kalloc PROTOTYPE
PARAMETERS VALUE UINT n_elements, VALUE UINT element_size
FUNCTION LONG mavail PROTOTYPE && returns free memory in bytes
*-------------------------------------------------------------------------
#define POINTER_SIZE 4 && pointers are four bytes...
#ifndef NULL
# define NULL 0
#endif
#define PAGESIZE 2048 && The size of my disk page
#define SAFETY_FACTOR 5120 && Always leave at least 5K avail.
#endif && ALLOC_HDR
See Also:
HEAP.hdr
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson