2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = glib-Memory-Allocators.html
49 module glib
.Allocator
;
51 private import glib
.glibtypes
;
53 private import lib
.glib
;
55 private import glib
.Str
;
59 * Prior to 2.10, GAllocator was used as an efficient way to allocate
60 * small pieces of memory for use with the GList, GSList and GNode data
61 * structures. Since 2.10, it has been completely replaced by the
62 * slice allocator and deprecated.
64 public class Allocator
67 /** the main Gtk struct */
68 protected GAllocator
* gAllocator
;
71 public GAllocator
* getAllocatorStruct()
77 /** the main Gtk struct as a void* */
78 protected void* getStruct()
80 return cast(void*)gAllocator
;
84 * Sets our main struct and passes it to the parent class
86 public this (GAllocator
* gAllocator
)
88 this.gAllocator
= gAllocator
;
97 * g_allocator_new has been deprecated since version 2.10 and should not be used in newly-written code. Use the slice allocator
99 * Creates a new GAllocator.
101 * the name of the GAllocator. This name is used to set the name of the
102 * GMemChunk used by the GAllocator, and is only used for debugging.
104 * the number of elements in each block of memory allocated.
105 * Larger blocks mean less calls to g_malloc(), but some memory may be wasted.
106 * (GLib uses 128 elements per block by default.) The value must be between 1
111 public this (char[] name
, uint nPreallocs
)
113 // GAllocator* g_allocator_new (const gchar *name, guint n_preallocs);
114 this(cast(GAllocator
*)g_allocator_new(Str
.toStringz(name
), nPreallocs
) );
119 * g_allocator_free has been deprecated since version 2.10 and should not be used in newly-written code. Use the slice allocator
121 * Frees all of the memory allocated by the GAllocator.
127 // void g_allocator_free (GAllocator *allocator);
128 g_allocator_free(gAllocator
);