+2001-05-23 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * garray.c (g_array_remove_index_fast): Tiny speed improvement
+ suggested by noon@users.sourceforge.net.
+
2001-05-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* config.h.win32.in: Removed POSIX_*. Defined G_THREAD_SOURCE to
+2001-05-23 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * garray.c (g_array_remove_index_fast): Tiny speed improvement
+ suggested by noon@users.sourceforge.net.
+
2001-05-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* config.h.win32.in: Removed POSIX_*. Defined G_THREAD_SOURCE to
+2001-05-23 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * garray.c (g_array_remove_index_fast): Tiny speed improvement
+ suggested by noon@users.sourceforge.net.
+
2001-05-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* config.h.win32.in: Removed POSIX_*. Defined G_THREAD_SOURCE to
+2001-05-23 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * garray.c (g_array_remove_index_fast): Tiny speed improvement
+ suggested by noon@users.sourceforge.net.
+
2001-05-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* config.h.win32.in: Removed POSIX_*. Defined G_THREAD_SOURCE to
+2001-05-23 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * garray.c (g_array_remove_index_fast): Tiny speed improvement
+ suggested by noon@users.sourceforge.net.
+
2001-05-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* config.h.win32.in: Removed POSIX_*. Defined G_THREAD_SOURCE to
+2001-05-23 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * garray.c (g_array_remove_index_fast): Tiny speed improvement
+ suggested by noon@users.sourceforge.net.
+
2001-05-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* config.h.win32.in: Removed POSIX_*. Defined G_THREAD_SOURCE to
+2001-05-23 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * garray.c (g_array_remove_index_fast): Tiny speed improvement
+ suggested by noon@users.sourceforge.net.
+
2001-05-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* config.h.win32.in: Removed POSIX_*. Defined G_THREAD_SOURCE to
+2001-05-23 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * garray.c (g_array_remove_index_fast): Tiny speed improvement
+ suggested by noon@users.sourceforge.net.
+
2001-05-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* config.h.win32.in: Removed POSIX_*. Defined G_THREAD_SOURCE to
+2001-05-23 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * glib/tmpl/arrays.sgml, glib/tmpl/arrays_pointers.sgml,
+ glib/tmpl/arrays_byte.sgml: Corrected documentation for the
+ ..._sized_new functions. Discovered by noon@users.sourceforge.net.
+
2001-05-19 Havoc Pennington <hp@pobox.com>
* glib/Makefile.am (IGNORE_HFILES): add glibintl.h
<!-- ##### FUNCTION g_array_sized_new ##### -->
<para>
-Creates a new #GArray with the given size.
+Creates a new #GArray with @reserved_size elements
+preallocated. This avoids frequent reallocation, if you are going to
+add many elements to the array. Note however that the size of the
+array is still 0.
</para>
@zero_terminated: %TRUE if the array should have an extra element at the end with all bits cleared
@clear: %TRUE if all bits in the array should be cleared to 0 on allocation
@element_size: size of each element in the array
-@reserved_size: initial array size (number of elements)
+@reserved_size: number of elements preallocated
@Returns: the new #GArray
<!-- ##### FUNCTION g_byte_array_sized_new ##### -->
<para>
-Creates a new byte array, with the given size.
+Creates a new #GByteArray with @reserved_size bytes preallocated. This
+avoids frequent reallocation, if you are going to add many bytes to
+the array. Note however that the size of the array is still 0.
</para>
-@reserved_size: initial number of bytes in the array
-@Returns: a new #GByteArray
+@reserved_size: number of bytes preallocated
+@Returns: the new #GByteArray
<!-- ##### FUNCTION g_byte_array_append ##### -->
<!-- ##### FUNCTION g_ptr_array_sized_new ##### -->
<para>
-Creates a new #GPtrArray with @reserved_size elements.
+Creates a new #GPtrArray with @reserved_size pointers
+preallocated. This avoids frequent reallocation, if you are going to
+add many pointers to the array. Note however that the size of the
+array is still 0.
</para>
-@reserved_size: Initial number of elements.
+@reserved_size: number of pointers preallocated.
@Returns: the new #GPtrArray.
g_return_val_if_fail (index < array->len, NULL);
if (index != array->len - 1)
- g_memmove (g_array_elt_pos (array, index),
- g_array_elt_pos (array, array->len - 1),
- g_array_elt_len (array, 1));
+ memcpy (g_array_elt_pos (array, index),
+ g_array_elt_pos (array, array->len - 1),
+ g_array_elt_len (array, 1));
array->len -= 1;
g_return_val_if_fail (index < array->len, NULL);
if (index != array->len - 1)
- g_memmove (g_array_elt_pos (array, index),
- g_array_elt_pos (array, array->len - 1),
- g_array_elt_len (array, 1));
+ memcpy (g_array_elt_pos (array, index),
+ g_array_elt_pos (array, array->len - 1),
+ g_array_elt_len (array, 1));
array->len -= 1;