/*
 * subAlloc.h
 *
 * [Generated from subAlloc, 25 September 1996]
 */

#if !defined(__CC_NORCROFT) || !defined(__arm)
  #error You must use the Norcroft ARM Compiler for Sapphire programs
#endif

#pragma include_only_once
#pragma force_top_level

#ifndef __subAlloc_h
#define __subAlloc_h

#ifndef __sapphire_h
  #include "sapphire.h"
#endif

/*----- Overview ----------------------------------------------------------*
 *
 * Functions provided:
 *
 *  sub_alloc
 *  sub_free
 *  sub_init
 */

/* --- sub_alloc --- *
 *
 * On entry:	R0 == size of block to allocate
 *
 * On exit:	R0 == pointer to block allocated
 *		May return an error
 *
 * Use:		Allocates a block of the size specified, typically very
 *		quickly indeed.
 *
 *		If the size is not one of those supported (currently
 *		supported sizes are 8-40 inclusive in 4 byte increments),
 *		the behaviour is undefined (but very predictable).
 */

extern routine sub_alloc;

/* --- sub_free --- *
 *
 * On entry:	R0 == pointer to block
 *		R1 == size of the block
 *
 * On exit:	--
 *
 * Use:		Frees a block allocated using sub_alloc.
 */

extern routine sub_free;

/* --- sub_init --- *
 *
 * On entry:	--
 *
 * On exit:	--
 *
 * Use:		Initialises the suballocation system for use.
 */

extern routine sub_init;

/*----- That's all, folks -------------------------------------------------*/

#endif
