mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
use g_mem_chunk_alloc0() to allocate the memchunk, so the correct size of
Sat Sep 5 04:40:02 1998 Tim Janik <timj@gtk.org> * glib.h: (g_chunk_new0): use g_mem_chunk_alloc0() to allocate the memchunk, so the correct size of the memchunk is allocated with 0's and not a memory portion of the size of the desired type. * gmem.c: new function g_mem_chunk_alloc0() which will initialize a memory area allocated with g_mem_chunk_alloc() with 0's.
This commit is contained in:
parent
fa58379289
commit
1c3646f597
12
ChangeLog
12
ChangeLog
@ -1,6 +1,16 @@
|
|||||||
|
Sat Sep 5 04:40:02 1998 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* glib.h:
|
||||||
|
(g_chunk_new0): use g_mem_chunk_alloc0() to allocate the memchunk,
|
||||||
|
so the correct size of the memchunk is allocated with 0's and not
|
||||||
|
a memory portion of the size of the desired type.
|
||||||
|
|
||||||
|
* gmem.c: new function g_mem_chunk_alloc0() which will initialize
|
||||||
|
a memory area allocated with g_mem_chunk_alloc() with 0's.
|
||||||
|
|
||||||
Wed Sep 2 19:13:28 1998 Owen Taylor <otaylor@redhat.com>
|
Wed Sep 2 19:13:28 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* garray.c glib.h (g_array_[ap/pr]epend_vals): make
|
* garray.c glib.h (g_array_[ap/pre]pend_vals): make
|
||||||
data argument const.
|
data argument const.
|
||||||
|
|
||||||
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org>
|
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org>
|
||||||
|
@ -1,6 +1,16 @@
|
|||||||
|
Sat Sep 5 04:40:02 1998 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* glib.h:
|
||||||
|
(g_chunk_new0): use g_mem_chunk_alloc0() to allocate the memchunk,
|
||||||
|
so the correct size of the memchunk is allocated with 0's and not
|
||||||
|
a memory portion of the size of the desired type.
|
||||||
|
|
||||||
|
* gmem.c: new function g_mem_chunk_alloc0() which will initialize
|
||||||
|
a memory area allocated with g_mem_chunk_alloc() with 0's.
|
||||||
|
|
||||||
Wed Sep 2 19:13:28 1998 Owen Taylor <otaylor@redhat.com>
|
Wed Sep 2 19:13:28 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* garray.c glib.h (g_array_[ap/pr]epend_vals): make
|
* garray.c glib.h (g_array_[ap/pre]pend_vals): make
|
||||||
data argument const.
|
data argument const.
|
||||||
|
|
||||||
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org>
|
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org>
|
||||||
|
@ -1,6 +1,16 @@
|
|||||||
|
Sat Sep 5 04:40:02 1998 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* glib.h:
|
||||||
|
(g_chunk_new0): use g_mem_chunk_alloc0() to allocate the memchunk,
|
||||||
|
so the correct size of the memchunk is allocated with 0's and not
|
||||||
|
a memory portion of the size of the desired type.
|
||||||
|
|
||||||
|
* gmem.c: new function g_mem_chunk_alloc0() which will initialize
|
||||||
|
a memory area allocated with g_mem_chunk_alloc() with 0's.
|
||||||
|
|
||||||
Wed Sep 2 19:13:28 1998 Owen Taylor <otaylor@redhat.com>
|
Wed Sep 2 19:13:28 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* garray.c glib.h (g_array_[ap/pr]epend_vals): make
|
* garray.c glib.h (g_array_[ap/pre]pend_vals): make
|
||||||
data argument const.
|
data argument const.
|
||||||
|
|
||||||
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org>
|
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org>
|
||||||
|
@ -1,6 +1,16 @@
|
|||||||
|
Sat Sep 5 04:40:02 1998 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* glib.h:
|
||||||
|
(g_chunk_new0): use g_mem_chunk_alloc0() to allocate the memchunk,
|
||||||
|
so the correct size of the memchunk is allocated with 0's and not
|
||||||
|
a memory portion of the size of the desired type.
|
||||||
|
|
||||||
|
* gmem.c: new function g_mem_chunk_alloc0() which will initialize
|
||||||
|
a memory area allocated with g_mem_chunk_alloc() with 0's.
|
||||||
|
|
||||||
Wed Sep 2 19:13:28 1998 Owen Taylor <otaylor@redhat.com>
|
Wed Sep 2 19:13:28 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* garray.c glib.h (g_array_[ap/pr]epend_vals): make
|
* garray.c glib.h (g_array_[ap/pre]pend_vals): make
|
||||||
data argument const.
|
data argument const.
|
||||||
|
|
||||||
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org>
|
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org>
|
||||||
|
@ -1,6 +1,16 @@
|
|||||||
|
Sat Sep 5 04:40:02 1998 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* glib.h:
|
||||||
|
(g_chunk_new0): use g_mem_chunk_alloc0() to allocate the memchunk,
|
||||||
|
so the correct size of the memchunk is allocated with 0's and not
|
||||||
|
a memory portion of the size of the desired type.
|
||||||
|
|
||||||
|
* gmem.c: new function g_mem_chunk_alloc0() which will initialize
|
||||||
|
a memory area allocated with g_mem_chunk_alloc() with 0's.
|
||||||
|
|
||||||
Wed Sep 2 19:13:28 1998 Owen Taylor <otaylor@redhat.com>
|
Wed Sep 2 19:13:28 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* garray.c glib.h (g_array_[ap/pr]epend_vals): make
|
* garray.c glib.h (g_array_[ap/pre]pend_vals): make
|
||||||
data argument const.
|
data argument const.
|
||||||
|
|
||||||
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org>
|
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org>
|
||||||
|
@ -1,6 +1,16 @@
|
|||||||
|
Sat Sep 5 04:40:02 1998 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* glib.h:
|
||||||
|
(g_chunk_new0): use g_mem_chunk_alloc0() to allocate the memchunk,
|
||||||
|
so the correct size of the memchunk is allocated with 0's and not
|
||||||
|
a memory portion of the size of the desired type.
|
||||||
|
|
||||||
|
* gmem.c: new function g_mem_chunk_alloc0() which will initialize
|
||||||
|
a memory area allocated with g_mem_chunk_alloc() with 0's.
|
||||||
|
|
||||||
Wed Sep 2 19:13:28 1998 Owen Taylor <otaylor@redhat.com>
|
Wed Sep 2 19:13:28 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* garray.c glib.h (g_array_[ap/pr]epend_vals): make
|
* garray.c glib.h (g_array_[ap/pre]pend_vals): make
|
||||||
data argument const.
|
data argument const.
|
||||||
|
|
||||||
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org>
|
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org>
|
||||||
|
@ -1,6 +1,16 @@
|
|||||||
|
Sat Sep 5 04:40:02 1998 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* glib.h:
|
||||||
|
(g_chunk_new0): use g_mem_chunk_alloc0() to allocate the memchunk,
|
||||||
|
so the correct size of the memchunk is allocated with 0's and not
|
||||||
|
a memory portion of the size of the desired type.
|
||||||
|
|
||||||
|
* gmem.c: new function g_mem_chunk_alloc0() which will initialize
|
||||||
|
a memory area allocated with g_mem_chunk_alloc() with 0's.
|
||||||
|
|
||||||
Wed Sep 2 19:13:28 1998 Owen Taylor <otaylor@redhat.com>
|
Wed Sep 2 19:13:28 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* garray.c glib.h (g_array_[ap/pr]epend_vals): make
|
* garray.c glib.h (g_array_[ap/pre]pend_vals): make
|
||||||
data argument const.
|
data argument const.
|
||||||
|
|
||||||
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org>
|
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org>
|
||||||
|
@ -1,6 +1,16 @@
|
|||||||
|
Sat Sep 5 04:40:02 1998 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* glib.h:
|
||||||
|
(g_chunk_new0): use g_mem_chunk_alloc0() to allocate the memchunk,
|
||||||
|
so the correct size of the memchunk is allocated with 0's and not
|
||||||
|
a memory portion of the size of the desired type.
|
||||||
|
|
||||||
|
* gmem.c: new function g_mem_chunk_alloc0() which will initialize
|
||||||
|
a memory area allocated with g_mem_chunk_alloc() with 0's.
|
||||||
|
|
||||||
Wed Sep 2 19:13:28 1998 Owen Taylor <otaylor@redhat.com>
|
Wed Sep 2 19:13:28 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* garray.c glib.h (g_array_[ap/pr]epend_vals): make
|
* garray.c glib.h (g_array_[ap/pre]pend_vals): make
|
||||||
data argument const.
|
data argument const.
|
||||||
|
|
||||||
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org>
|
Wed Aug 26 06:32:40 1998 Tim Janik <timj@gtk.org>
|
||||||
|
3
glib.h
3
glib.h
@ -273,7 +273,7 @@
|
|||||||
(type *) g_mem_chunk_alloc (chunk) \
|
(type *) g_mem_chunk_alloc (chunk) \
|
||||||
)
|
)
|
||||||
#define g_chunk_new0(type, chunk) ( \
|
#define g_chunk_new0(type, chunk) ( \
|
||||||
(type *) memset (g_mem_chunk_alloc (chunk), 0, sizeof (type)) \
|
(type *) g_mem_chunk_alloc0 (chunk) \
|
||||||
)
|
)
|
||||||
#define g_chunk_free(mem, mem_chunk) G_STMT_START { \
|
#define g_chunk_free(mem, mem_chunk) G_STMT_START { \
|
||||||
g_mem_chunk_free ((mem_chunk), (mem)); \
|
g_mem_chunk_free ((mem_chunk), (mem)); \
|
||||||
@ -1087,6 +1087,7 @@ GMemChunk* g_mem_chunk_new (gchar *name,
|
|||||||
gint type);
|
gint type);
|
||||||
void g_mem_chunk_destroy (GMemChunk *mem_chunk);
|
void g_mem_chunk_destroy (GMemChunk *mem_chunk);
|
||||||
gpointer g_mem_chunk_alloc (GMemChunk *mem_chunk);
|
gpointer g_mem_chunk_alloc (GMemChunk *mem_chunk);
|
||||||
|
gpointer g_mem_chunk_alloc0 (GMemChunk *mem_chunk);
|
||||||
void g_mem_chunk_free (GMemChunk *mem_chunk,
|
void g_mem_chunk_free (GMemChunk *mem_chunk,
|
||||||
gpointer mem);
|
gpointer mem);
|
||||||
void g_mem_chunk_clean (GMemChunk *mem_chunk);
|
void g_mem_chunk_clean (GMemChunk *mem_chunk);
|
||||||
|
@ -273,7 +273,7 @@
|
|||||||
(type *) g_mem_chunk_alloc (chunk) \
|
(type *) g_mem_chunk_alloc (chunk) \
|
||||||
)
|
)
|
||||||
#define g_chunk_new0(type, chunk) ( \
|
#define g_chunk_new0(type, chunk) ( \
|
||||||
(type *) memset (g_mem_chunk_alloc (chunk), 0, sizeof (type)) \
|
(type *) g_mem_chunk_alloc0 (chunk) \
|
||||||
)
|
)
|
||||||
#define g_chunk_free(mem, mem_chunk) G_STMT_START { \
|
#define g_chunk_free(mem, mem_chunk) G_STMT_START { \
|
||||||
g_mem_chunk_free ((mem_chunk), (mem)); \
|
g_mem_chunk_free ((mem_chunk), (mem)); \
|
||||||
@ -1087,6 +1087,7 @@ GMemChunk* g_mem_chunk_new (gchar *name,
|
|||||||
gint type);
|
gint type);
|
||||||
void g_mem_chunk_destroy (GMemChunk *mem_chunk);
|
void g_mem_chunk_destroy (GMemChunk *mem_chunk);
|
||||||
gpointer g_mem_chunk_alloc (GMemChunk *mem_chunk);
|
gpointer g_mem_chunk_alloc (GMemChunk *mem_chunk);
|
||||||
|
gpointer g_mem_chunk_alloc0 (GMemChunk *mem_chunk);
|
||||||
void g_mem_chunk_free (GMemChunk *mem_chunk,
|
void g_mem_chunk_free (GMemChunk *mem_chunk,
|
||||||
gpointer mem);
|
gpointer mem);
|
||||||
void g_mem_chunk_clean (GMemChunk *mem_chunk);
|
void g_mem_chunk_clean (GMemChunk *mem_chunk);
|
||||||
|
16
glib/gmem.c
16
glib/gmem.c
@ -617,6 +617,22 @@ outa_here:
|
|||||||
return mem;
|
return mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gpointer
|
||||||
|
g_mem_chunk_alloc0 (GMemChunk *mem_chunk)
|
||||||
|
{
|
||||||
|
gpointer mem;
|
||||||
|
|
||||||
|
mem = g_mem_chunk_alloc (mem_chunk);
|
||||||
|
if (mem)
|
||||||
|
{
|
||||||
|
GRealMemChunk *rmem_chunk = (GRealMemChunk*) mem_chunk;
|
||||||
|
|
||||||
|
memset (mem, 0, rmem_chunk->atom_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
return mem;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
g_mem_chunk_free (GMemChunk *mem_chunk,
|
g_mem_chunk_free (GMemChunk *mem_chunk,
|
||||||
gpointer mem)
|
gpointer mem)
|
||||||
|
16
gmem.c
16
gmem.c
@ -617,6 +617,22 @@ outa_here:
|
|||||||
return mem;
|
return mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gpointer
|
||||||
|
g_mem_chunk_alloc0 (GMemChunk *mem_chunk)
|
||||||
|
{
|
||||||
|
gpointer mem;
|
||||||
|
|
||||||
|
mem = g_mem_chunk_alloc (mem_chunk);
|
||||||
|
if (mem)
|
||||||
|
{
|
||||||
|
GRealMemChunk *rmem_chunk = (GRealMemChunk*) mem_chunk;
|
||||||
|
|
||||||
|
memset (mem, 0, rmem_chunk->atom_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
return mem;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
g_mem_chunk_free (GMemChunk *mem_chunk,
|
g_mem_chunk_free (GMemChunk *mem_chunk,
|
||||||
gpointer mem)
|
gpointer mem)
|
||||||
|
Loading…
Reference in New Issue
Block a user