/* libsizzle/alloc.h - memory allocation module declarations
 
  Copyright (C) 1999, 2000 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
 
  This 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.
  
  This software 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 this package; see the file COPYING.  If not, write to
  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */

#ifndef __SIZZLE_ALLOC_H__
#define __SIZZLE_ALLOC_H__

#if HAVE_CONFIG_H
# include <config.h>
#endif 

#if __SIZZLE_IMPORT__
# define SIZZLE_API __declspec (dllimport)
#elif __SIZZLE_EXPORT__ 
# define SIZZLE_API __declspec (dllexport)
#else
# define SIZZLE_API
#endif

/* Count the amount of allocated memory in bytes.  */
SIZZLE_API extern unsigned zzz_allocated_bytes;

/* Allocate a given number of bytes, abort the program if there is no
   memory left.  */
SIZZLE_API void * zzz_malloc (unsigned size);

/* Change the size of a xmalloc()'ed block of memory.  Abort the
   program if there is no memory left.  */
SIZZLE_API void * zzz_realloc (void * ptr, unsigned size, unsigned old_size);

/* Free a block of xmalloc()'ed or xrealloc()'ed memory.  */
SIZZLE_API void zzz_free (void * ptr, unsigned size);

#endif /* not __SIZZLE_ALLOC_H__ */
