1 /* Copyright (C) 2001-2006 Artifex Software, Inc. 2 All Rights Reserved. 3 4 This software is provided AS-IS with no warranty, either express or 5 implied. 6 7 This software is distributed under license and may not be copied, modified 8 or distributed except as expressly authorized under the terms of that 9 license. Refer to licensing information at http://www.artifex.com/ 10 or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, 11 San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information. 12 */ 13 14 /* $Id: gsmchunk.h 8750 2008-05-20 20:34:52Z ray $ */ 15 /* chunk consolidating wrapper on a base memory allocator */ 16 17 #ifndef gsmchunk_INCLUDED 18 # define gsmchunk_INCLUDED 19 20 #define CHUNK_SIZE 65536 21 22 /* ---------- Public constructors/destructors ---------- */ 23 24 /* Initialize a gs_memory_chunk_t */ 25 /* -ve error code or 0 */ 26 int gs_memory_chunk_wrap(gs_memory_t **wrapped, /* chunk allocator init */ 27 gs_memory_t * target ); /* base allocator */ 28 29 /* Release a chunk memory manager and all of the memory it held */ 30 void gs_memory_chunk_release(gs_memory_t *cmem); 31 32 /* ---------- Accessors ------------- */ 33 34 /* Retrieve this allocator's target */ 35 gs_memory_t *gs_memory_chunk_target(const gs_memory_t *cmem); 36 37 #ifdef DEBUG 38 void gs_memory_chunk_dump_memory(const gs_memory_t *mem); 39 40 int chunk_allocator_unit_test(gs_memory_t *mem); 41 #endif /* DEBUG */ 42 43 #endif /* gsmchunk_INCLUDED */ 44