epoc32/include/stdapis/glib-2.0/glib/gslice.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/stdapis/glib-2.0/glib/gslice.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/stdapis/glib-2.0/glib/gslice.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,78 @@
     1.4 -gslice.h
     1.5 +/* GLIB sliced memory - fast threaded memory chunk allocator
     1.6 + * Copyright (C) 2005 Tim Janik
     1.7 + * Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
     1.8 + *
     1.9 + * This library is free software; you can redistribute it and/or
    1.10 + * modify it under the terms of the GNU Lesser General Public
    1.11 + * License as published by the Free Software Foundation; either
    1.12 + * version 2 of the License, or (at your option) any later version.
    1.13 + *
    1.14 + * This library is distributed in the hope that it will be useful,
    1.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.17 + * Lesser General Public License for more details.
    1.18 + *
    1.19 + * You should have received a copy of the GNU Lesser General Public
    1.20 + * License along with this library; if not, write to the
    1.21 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    1.22 + * Boston, MA 02111-1307, USA.
    1.23 + */
    1.24 +#ifndef __G_SLICE_H__
    1.25 +#define __G_SLICE_H__
    1.26 +
    1.27 +#ifndef __G_MEM_H__
    1.28 +#error Include <glib.h> instead of <gslice.h>
    1.29 +#endif
    1.30 +
    1.31 +#include <glib/gtypes.h>
    1.32 +
    1.33 +G_BEGIN_DECLS
    1.34 +
    1.35 +/* slices - fast allocation/release of small memory blocks
    1.36 + */
    1.37 +IMPORT_C gpointer g_slice_alloc          	(gsize	  block_size) G_GNUC_MALLOC;
    1.38 +IMPORT_C gpointer g_slice_alloc0         	(gsize    block_size) G_GNUC_MALLOC;
    1.39 +IMPORT_C void     g_slice_free1          	(gsize    block_size,
    1.40 +					 gpointer mem_block);
    1.41 +IMPORT_C void     g_slice_free_chain_with_offset (gsize    block_size,
    1.42 +					 gpointer mem_chain,
    1.43 +					 gsize    next_offset);
    1.44 +#define  g_slice_new(type)      ((type*) g_slice_alloc (sizeof (type)))
    1.45 +#define  g_slice_new0(type)     ((type*) g_slice_alloc0 (sizeof (type)))
    1.46 +/*       g_slice_free                   (MemoryBlockType,
    1.47 + *	                                 MemoryBlockType *mem_block);
    1.48 + *       g_slice_free_chain             (MemoryBlockType,
    1.49 + *                                       MemoryBlockType *first_chain_block,
    1.50 + *                                       memory_block_next_field);
    1.51 + * pseudo prototypes for the macro
    1.52 + * definitions following below.
    1.53 + */
    1.54 +
    1.55 +/* we go through extra hoops to ensure type safety */
    1.56 +#define g_slice_free(type, mem)				do {	\
    1.57 +  if (1) g_slice_free1 (sizeof (type), (mem));			\
    1.58 +  else   (void) ((type*) 0 == (mem)); 				\
    1.59 +} while (0)
    1.60 +#define g_slice_free_chain(type, mem_chain, next)	do {	\
    1.61 +  if (1) g_slice_free_chain_with_offset (sizeof (type),		\
    1.62 +                 (mem_chain), G_STRUCT_OFFSET (type, next)); 	\
    1.63 +  else   (void) ((type*) 0 == (mem_chain));			\
    1.64 +} while (0)
    1.65 +
    1.66 +
    1.67 +/* --- internal debugging API --- */
    1.68 +typedef enum {
    1.69 +  G_SLICE_CONFIG_ALWAYS_MALLOC = 1,
    1.70 +  G_SLICE_CONFIG_BYPASS_MAGAZINES,
    1.71 +  G_SLICE_CONFIG_WORKING_SET_MSECS,
    1.72 +  G_SLICE_CONFIG_COLOR_INCREMENT,
    1.73 +  G_SLICE_CONFIG_CHUNK_SIZES,
    1.74 +  G_SLICE_CONFIG_CONTENTION_COUNTER
    1.75 +} GSliceConfig;
    1.76 +void     g_slice_set_config	   (GSliceConfig ckey, gint64 value);
    1.77 +gint64   g_slice_get_config	   (GSliceConfig ckey);
    1.78 +gint64*  g_slice_get_config_state  (GSliceConfig ckey, gint64 address, guint *n_values);
    1.79 +
    1.80 +G_END_DECLS
    1.81 +
    1.82 +#endif /* __G_SLICE_H__ */