/* * indir.h * * Control of indirected data allocation * * © 1994-1998 Straylight */ /*----- Licensing note ----------------------------------------------------* * * This file is part of Straylight's Glass. * * Glass is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * Glass is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Glass. If not, write to the Free Software Foundation, * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __indir_h #define __indir_h /*----- External routines -------------------------------------------------*/ #ifndef __size_t #define __size_t 1 typedef unsigned int size_t; /* from */ #endif /* * void indir_init(void) * * Use * Jumps in to ensure that indir gets the first flex block, so it doesn't * move. */ void indir_init(void); /* * void *indir_alloc(int size) * * Use * Allocate memory from heap. * * Parameters * int size == the number of bytes the caller wants */ void *indir_alloc(size_t size); /* * void indir_free(void *p) * * Use * Reclaims the memory from the block pointed to by p. Some simple checks * are used to ensure that p is valid. * * Parameters * void *p == pointer to a block to free. */ void indir_free(void *p); /* * void *indir_realloc(void *p,int newsize) * * Use * Resizes a heap block. * * Parameters * void *p == pointer to block to resize * int newsize == the new size to make it * * Returns * Pointer to the block (may have moved) or 0 (failure, block didn't move) */ void *indir_realloc(void *p,int newsize); /* * void indir_heapInfo(void) * * Use * Displays a dialogue box showing current heap stats */ void indir_heapInfo(void); #endif