mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-28 02:20:04 +01:00
fixed buglets reported by Jens Granseuer in #328254.
Wed Jan 25 19:16:57 2006 Tim Janik <timj@imendio.com> * fixed buglets reported by Jens Granseuer in #328254. * configure.in: free the memory allocated in posix_memalign() tests. * glib/gslice.c: spelling fixes.
This commit is contained in:
parent
4ec9e3a40d
commit
bd88bf87da
@ -1,3 +1,11 @@
|
|||||||
|
Wed Jan 25 19:16:57 2006 Tim Janik <timj@imendio.com>
|
||||||
|
|
||||||
|
* fixed buglets reported by Jens Granseuer in #328254.
|
||||||
|
|
||||||
|
* configure.in: free the memory allocated in posix_memalign() tests.
|
||||||
|
|
||||||
|
* glib/gslice.c: spelling fixes.
|
||||||
|
|
||||||
Wed Jan 25 16:39:18 2006 Tim Janik <timj@imendio.com>
|
Wed Jan 25 16:39:18 2006 Tim Janik <timj@imendio.com>
|
||||||
|
|
||||||
* glib/gslice.c: honour g_mem_gc_friendly settings when freeing
|
* glib/gslice.c: honour g_mem_gc_friendly settings when freeing
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
Wed Jan 25 19:16:57 2006 Tim Janik <timj@imendio.com>
|
||||||
|
|
||||||
|
* fixed buglets reported by Jens Granseuer in #328254.
|
||||||
|
|
||||||
|
* configure.in: free the memory allocated in posix_memalign() tests.
|
||||||
|
|
||||||
|
* glib/gslice.c: spelling fixes.
|
||||||
|
|
||||||
Wed Jan 25 16:39:18 2006 Tim Janik <timj@imendio.com>
|
Wed Jan 25 16:39:18 2006 Tim Janik <timj@imendio.com>
|
||||||
|
|
||||||
* glib/gslice.c: honour g_mem_gc_friendly settings when freeing
|
* glib/gslice.c: honour g_mem_gc_friendly settings when freeing
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
Wed Jan 25 19:16:57 2006 Tim Janik <timj@imendio.com>
|
||||||
|
|
||||||
|
* fixed buglets reported by Jens Granseuer in #328254.
|
||||||
|
|
||||||
|
* configure.in: free the memory allocated in posix_memalign() tests.
|
||||||
|
|
||||||
|
* glib/gslice.c: spelling fixes.
|
||||||
|
|
||||||
Wed Jan 25 16:39:18 2006 Tim Janik <timj@imendio.com>
|
Wed Jan 25 16:39:18 2006 Tim Janik <timj@imendio.com>
|
||||||
|
|
||||||
* glib/gslice.c: honour g_mem_gc_friendly settings when freeing
|
* glib/gslice.c: honour g_mem_gc_friendly settings when freeing
|
||||||
|
@ -1034,6 +1034,8 @@ AC_CACHE_VAL(glib_cv_compliant_posix_memalign,[
|
|||||||
void *mem = 0;
|
void *mem = 0;
|
||||||
if (posix_memalign (&mem, boundary, size) != 0 || !mem)
|
if (posix_memalign (&mem, boundary, size) != 0 || !mem)
|
||||||
exit (1);
|
exit (1);
|
||||||
|
else
|
||||||
|
free (mem);
|
||||||
}
|
}
|
||||||
int main() {
|
int main() {
|
||||||
test_memalign ( 128, 128 - 2 * sizeof (void*));
|
test_memalign ( 128, 128 - 2 * sizeof (void*));
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined HAVE_POSIX_MEMALIGN && defined POSIX_MEMALIGN_WITH_COMPLIANT_ALLOCS
|
#if defined HAVE_POSIX_MEMALIGN && defined POSIX_MEMALIGN_WITH_COMPLIANT_ALLOCS
|
||||||
# define HAVE_COMLIANT_POSIX_MEMALIGN 1
|
# define HAVE_COMPLIANT_POSIX_MEMALIGN 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -297,7 +297,7 @@ g_slice_init_nomessage (void)
|
|||||||
mem_assert ((sys_page_size & (sys_page_size - 1)) == 0);
|
mem_assert ((sys_page_size & (sys_page_size - 1)) == 0);
|
||||||
slice_config_init (&allocator->config);
|
slice_config_init (&allocator->config);
|
||||||
allocator->min_page_size = sys_page_size;
|
allocator->min_page_size = sys_page_size;
|
||||||
#if HAVE_COMLIANT_POSIX_MEMALIGN || HAVE_MEMALIGN
|
#if HAVE_COMPLIANT_POSIX_MEMALIGN || HAVE_MEMALIGN
|
||||||
/* allow allocation of pages up to 8KB (with 8KB alignment).
|
/* allow allocation of pages up to 8KB (with 8KB alignment).
|
||||||
* this is useful because many medium to large sized structures
|
* this is useful because many medium to large sized structures
|
||||||
* fit less than 8 times (see [4]) into 4KB pages.
|
* fit less than 8 times (see [4]) into 4KB pages.
|
||||||
@ -1045,13 +1045,13 @@ slab_allocator_free_chunk (gsize chunk_size,
|
|||||||
|
|
||||||
/* from config.h:
|
/* from config.h:
|
||||||
* define HAVE_POSIX_MEMALIGN 1 // if free(posix_memalign(3)) works, <stdlib.h>
|
* define HAVE_POSIX_MEMALIGN 1 // if free(posix_memalign(3)) works, <stdlib.h>
|
||||||
* define HAVE_COMLIANT_POSIX_MEMALIGN 1 // if free(posix_memalign(3)) works for sizes != 2^n, <stdlib.h>
|
* define HAVE_COMPLIANT_POSIX_MEMALIGN 1 // if free(posix_memalign(3)) works for sizes != 2^n, <stdlib.h>
|
||||||
* define HAVE_MEMALIGN 1 // if free(memalign(3)) works, <malloc.h>
|
* define HAVE_MEMALIGN 1 // if free(memalign(3)) works, <malloc.h>
|
||||||
* define HAVE_VALLOC 1 // if free(valloc(3)) works, <stdlib.h> or <malloc.h>
|
* define HAVE_VALLOC 1 // if free(valloc(3)) works, <stdlib.h> or <malloc.h>
|
||||||
* if none is provided, we implement malloc(3)-based alloc-only page alignment
|
* if none is provided, we implement malloc(3)-based alloc-only page alignment
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !(HAVE_COMLIANT_POSIX_MEMALIGN || HAVE_MEMALIGN || HAVE_VALLOC)
|
#if !(HAVE_COMPLIANT_POSIX_MEMALIGN || HAVE_MEMALIGN || HAVE_VALLOC)
|
||||||
static GTrashStack *compat_valloc_trash = NULL;
|
static GTrashStack *compat_valloc_trash = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1061,7 +1061,7 @@ allocator_memalign (gsize alignment,
|
|||||||
{
|
{
|
||||||
gpointer aligned_memory = NULL;
|
gpointer aligned_memory = NULL;
|
||||||
gint err = ENOMEM;
|
gint err = ENOMEM;
|
||||||
#if HAVE_COMLIANT_POSIX_MEMALIGN
|
#if HAVE_COMPLIANT_POSIX_MEMALIGN
|
||||||
err = posix_memalign (&aligned_memory, alignment, memsize);
|
err = posix_memalign (&aligned_memory, alignment, memsize);
|
||||||
#elif HAVE_MEMALIGN
|
#elif HAVE_MEMALIGN
|
||||||
errno = 0;
|
errno = 0;
|
||||||
@ -1101,7 +1101,7 @@ static void
|
|||||||
allocator_memfree (gsize memsize,
|
allocator_memfree (gsize memsize,
|
||||||
gpointer mem)
|
gpointer mem)
|
||||||
{
|
{
|
||||||
#if HAVE_COMLIANT_POSIX_MEMALIGN || HAVE_MEMALIGN || HAVE_VALLOC
|
#if HAVE_COMPLIANT_POSIX_MEMALIGN || HAVE_MEMALIGN || HAVE_VALLOC
|
||||||
free (mem);
|
free (mem);
|
||||||
#else
|
#else
|
||||||
mem_assert (memsize <= sys_page_size);
|
mem_assert (memsize <= sys_page_size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user