1 /* 2 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) 3 * 4 * This library is free software: you can redistribute it and/or modify it 5 * under the terms of the GNU Lesser General Public License as published by 6 * the Free Software Foundation. 7 * 8 * This library is distributed in the hope that it will be useful, but 9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 10 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License 11 * for more details. 12 * 13 * You should have received a copy of the GNU Lesser General Public License 14 * along with this library. If not, see <http://www.gnu.org/licenses/>. 15 * 16 * Authors: Michael Zucchi <notzed@ximian.com> 17 * Jacob Berkman <jacob@ximian.com> 18 */ 19 20 #if !defined (__LIBEDATASERVER_H_INSIDE__) && !defined (LIBEDATASERVER_COMPILATION) 21 #error "Only <libedataserver/libedataserver.h> should be included directly." 22 #endif 23 24 #ifndef E_MEMORY_H 25 #define E_MEMORY_H 26 27 #include <glib.h> 28 29 G_BEGIN_DECLS 30 31 /* memchunks - allocate/free fixed-size blocks of memory */ 32 /* this is like gmemchunk, only faster and less overhead (only 4 bytes for every atomcount allocations) */ 33 typedef struct _EMemChunk EMemChunk; 34 35 EMemChunk * e_memchunk_new (gint atomcount, 36 gint atomsize); 37 gpointer e_memchunk_alloc (EMemChunk *memchunk); 38 gpointer e_memchunk_alloc0 (EMemChunk *memchunk); 39 void e_memchunk_free (EMemChunk *memchunk, 40 gpointer mem); 41 void e_memchunk_empty (EMemChunk *memchunk); 42 void e_memchunk_clean (EMemChunk *memchunk); 43 void e_memchunk_destroy (EMemChunk *memchunk); 44 45 G_END_DECLS 46 47 #endif /* E_MEMORY_H */ 48