From c3c1b2edc010c08ece04d8c48abc0074e1162d2d Mon Sep 17 00:00:00 2001 From: Sebastian Wilhelmi Date: Thu, 17 Dec 1998 08:02:38 +0000 Subject: [PATCH] Fixed size in g_memmove, reported by Alexander Larsson 1998-12-17 Sebastian Wilhelmi * garray.c (g_ptr_array_remove_index): Fixed size in g_memmove, reported by Alexander Larsson . * gmem.c: Fixed bug, that made compile fail for -DENABLE_MEM_PROFILE. --- ChangeLog | 7 +++++++ ChangeLog.pre-2-0 | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ ChangeLog.pre-2-12 | 7 +++++++ ChangeLog.pre-2-2 | 7 +++++++ ChangeLog.pre-2-4 | 7 +++++++ ChangeLog.pre-2-6 | 7 +++++++ ChangeLog.pre-2-8 | 7 +++++++ garray.c | 2 +- glib/garray.c | 2 +- glib/gmem.c | 12 ++++++------ gmem.c | 12 ++++++------ 12 files changed, 70 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5362d03..2342eeb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1998-12-17 Sebastian Wilhelmi + + * garray.c (g_ptr_array_remove_index): Fixed size in g_memmove, + reported by Alexander Larsson . + + * gmem.c: Fixed bug, that made compile fail for -DENABLE_MEM_PROFILE. + Wed Dec 16 23:04:26 CST 1998 Shawn T. Amundson * Released GLib 1.1.9 diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 5362d03..2342eeb 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,10 @@ +1998-12-17 Sebastian Wilhelmi + + * garray.c (g_ptr_array_remove_index): Fixed size in g_memmove, + reported by Alexander Larsson . + + * gmem.c: Fixed bug, that made compile fail for -DENABLE_MEM_PROFILE. + Wed Dec 16 23:04:26 CST 1998 Shawn T. Amundson * Released GLib 1.1.9 diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 5362d03..2342eeb 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +1998-12-17 Sebastian Wilhelmi + + * garray.c (g_ptr_array_remove_index): Fixed size in g_memmove, + reported by Alexander Larsson . + + * gmem.c: Fixed bug, that made compile fail for -DENABLE_MEM_PROFILE. + Wed Dec 16 23:04:26 CST 1998 Shawn T. Amundson * Released GLib 1.1.9 diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 5362d03..2342eeb 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,10 @@ +1998-12-17 Sebastian Wilhelmi + + * garray.c (g_ptr_array_remove_index): Fixed size in g_memmove, + reported by Alexander Larsson . + + * gmem.c: Fixed bug, that made compile fail for -DENABLE_MEM_PROFILE. + Wed Dec 16 23:04:26 CST 1998 Shawn T. Amundson * Released GLib 1.1.9 diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 5362d03..2342eeb 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,10 @@ +1998-12-17 Sebastian Wilhelmi + + * garray.c (g_ptr_array_remove_index): Fixed size in g_memmove, + reported by Alexander Larsson . + + * gmem.c: Fixed bug, that made compile fail for -DENABLE_MEM_PROFILE. + Wed Dec 16 23:04:26 CST 1998 Shawn T. Amundson * Released GLib 1.1.9 diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 5362d03..2342eeb 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +1998-12-17 Sebastian Wilhelmi + + * garray.c (g_ptr_array_remove_index): Fixed size in g_memmove, + reported by Alexander Larsson . + + * gmem.c: Fixed bug, that made compile fail for -DENABLE_MEM_PROFILE. + Wed Dec 16 23:04:26 CST 1998 Shawn T. Amundson * Released GLib 1.1.9 diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 5362d03..2342eeb 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +1998-12-17 Sebastian Wilhelmi + + * garray.c (g_ptr_array_remove_index): Fixed size in g_memmove, + reported by Alexander Larsson . + + * gmem.c: Fixed bug, that made compile fail for -DENABLE_MEM_PROFILE. + Wed Dec 16 23:04:26 CST 1998 Shawn T. Amundson * Released GLib 1.1.9 diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 5362d03..2342eeb 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +1998-12-17 Sebastian Wilhelmi + + * garray.c (g_ptr_array_remove_index): Fixed size in g_memmove, + reported by Alexander Larsson . + + * gmem.c: Fixed bug, that made compile fail for -DENABLE_MEM_PROFILE. + Wed Dec 16 23:04:26 CST 1998 Shawn T. Amundson * Released GLib 1.1.9 diff --git a/garray.c b/garray.c index 94c1b24..54bbe44 100644 --- a/garray.c +++ b/garray.c @@ -338,7 +338,7 @@ g_ptr_array_remove_index (GPtrArray* farray, if (index != array->len - 1) g_memmove (array->pdata + index, array->pdata + index + 1, - array->len - index - 1); + sizeof (gpointer) * (array->len - index - 1)); array->pdata[array->len - 1] = NULL; diff --git a/glib/garray.c b/glib/garray.c index 94c1b24..54bbe44 100644 --- a/glib/garray.c +++ b/glib/garray.c @@ -338,7 +338,7 @@ g_ptr_array_remove_index (GPtrArray* farray, if (index != array->len - 1) g_memmove (array->pdata + index, array->pdata + index + 1, - array->len - index - 1); + sizeof (gpointer) * (array->len - index - 1)); array->pdata[array->len - 1] = NULL; diff --git a/glib/gmem.c b/glib/gmem.c index a4907ff..697e9df 100644 --- a/glib/gmem.c +++ b/glib/gmem.c @@ -304,9 +304,9 @@ g_realloc (gpointer mem, #if defined(ENABLE_MEM_PROFILE) || defined(ENABLE_MEM_CHECK) t = (gulong*) ((guchar*) mem - SIZEOF_LONG); #ifdef ENABLE_MEM_PROFILE - g_mutex_lock (mem_profile); + g_mutex_lock (mem_profile_lock); freed_mem += *t; - g_mutex_unlock (mem_profile); + g_mutex_unlock (mem_profile_lock); #endif /* ENABLE_MEM_PROFILE */ mem = t; #endif /* ENABLE_MEM_PROFILE || ENABLE_MEM_CHECK */ @@ -375,9 +375,9 @@ g_free (gpointer mem) t = (gulong*) ((guchar*) mem - SIZEOF_LONG); size = *t; #ifdef ENABLE_MEM_PROFILE - g_mutex_lock (mem_profile); + g_mutex_lock (mem_profile_lock); freed_mem += size; - g_mutex_unlock (mem_profile); + g_mutex_unlock (mem_profile_lock); #endif /* ENABLE_MEM_PROFILE */ mem = t; #endif /* ENABLE_MEM_PROFILE || ENABLE_MEM_CHECK */ @@ -408,12 +408,12 @@ g_mem_profile (void) gulong local_allocated_mem; gulong local_freed_mem; - g_mutex_lock (mem_profile); + g_mutex_lock (mem_profile_lock); for (i = 0; i < (MEM_PROFILE_TABLE_SIZE - 1); i++) local_allocations[i] = allocations[i]; local_allocated_mem = allocated_mem; local_freed_mem = freed_mem; - g_mutex_unlock (mem_profile); + g_mutex_unlock (mem_profile_lock); for (i = 0; i < (MEM_PROFILE_TABLE_SIZE - 1); i++) if (local_allocations[i] > 0) diff --git a/gmem.c b/gmem.c index a4907ff..697e9df 100644 --- a/gmem.c +++ b/gmem.c @@ -304,9 +304,9 @@ g_realloc (gpointer mem, #if defined(ENABLE_MEM_PROFILE) || defined(ENABLE_MEM_CHECK) t = (gulong*) ((guchar*) mem - SIZEOF_LONG); #ifdef ENABLE_MEM_PROFILE - g_mutex_lock (mem_profile); + g_mutex_lock (mem_profile_lock); freed_mem += *t; - g_mutex_unlock (mem_profile); + g_mutex_unlock (mem_profile_lock); #endif /* ENABLE_MEM_PROFILE */ mem = t; #endif /* ENABLE_MEM_PROFILE || ENABLE_MEM_CHECK */ @@ -375,9 +375,9 @@ g_free (gpointer mem) t = (gulong*) ((guchar*) mem - SIZEOF_LONG); size = *t; #ifdef ENABLE_MEM_PROFILE - g_mutex_lock (mem_profile); + g_mutex_lock (mem_profile_lock); freed_mem += size; - g_mutex_unlock (mem_profile); + g_mutex_unlock (mem_profile_lock); #endif /* ENABLE_MEM_PROFILE */ mem = t; #endif /* ENABLE_MEM_PROFILE || ENABLE_MEM_CHECK */ @@ -408,12 +408,12 @@ g_mem_profile (void) gulong local_allocated_mem; gulong local_freed_mem; - g_mutex_lock (mem_profile); + g_mutex_lock (mem_profile_lock); for (i = 0; i < (MEM_PROFILE_TABLE_SIZE - 1); i++) local_allocations[i] = allocations[i]; local_allocated_mem = allocated_mem; local_freed_mem = freed_mem; - g_mutex_unlock (mem_profile); + g_mutex_unlock (mem_profile_lock); for (i = 0; i < (MEM_PROFILE_TABLE_SIZE - 1); i++) if (local_allocations[i] > 0) -- 2.7.4