[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
When should ralloc.c be used? (WAS: bug#24358)
From: |
npostavs |
Subject: |
When should ralloc.c be used? (WAS: bug#24358) |
Date: |
Fri, 21 Oct 2016 23:03:04 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Eli Zaretskii <address@hidden> writes:
>> Thread 1 "emacs" hit Hardware watchpoint 4: current_buffer->text->beg
>>
>> Old value = (unsigned char *) 0x18351b8 ""
>> New value = (unsigned char *) 0x188a1b8 ""
>> r_alloc_sbrk (size=290816) at ralloc.c:818
>
> r_alloc_sbrk? What OS is this? We only use ralloc.c on a handful of
> them, as of Emacs 25.
Should ralloc.c be used on GNU/Linux systems that have GNU libc?
I found this in my config.log (I think it's related to ralloc use,
though I'm finding the configure code a bit confusing):
configure:11440: checking whether malloc is Doug Lea style
configure:11461: gcc -o conftest -O0 -g3 -march=native conftest.c >&5
conftest.c: In function 'main':
conftest.c:107:6: error: '__malloc_initialize_hook' undeclared (first use
in this function)
__malloc_initialize_hook = hook;
^~~~~~~~~~~~~~~~~~~~~~~~
It seems that my malloc.h does not declare __malloc_initialize_hook,
even though 'man 3 malloc_hook' says
#include <malloc.h>
void *(*__malloc_hook)(size_t size, const void *caller);
void *(*__realloc_hook)(void *ptr, size_t size, const void *caller);
void *(*__memalign_hook)(size_t alignment, size_t size,
const void *caller);
void (*__free_hook)(void *ptr, const void *caller);
void (*__malloc_initialize_hook)(void);
void (*__after_morecore_hook)(void);
Perhaps this is because the recommended way to set this hook (which is
different from what the configure test is using) doesn't require a
declaration?
The variable __malloc_initialize_hook points at a function that is
called once when the mal‐
loc implementation is initialized. This is a weak variable, so it can
be overridden in the
application with a definition like the following:
void (*__malloc_initialize_hook)(void) = my_init_hook;
- When should ralloc.c be used? (WAS: bug#24358),
npostavs <=
- Re: When should ralloc.c be used? (WAS: bug#24358), Paul Eggert, 2016/10/22
- Re: When should ralloc.c be used? (WAS: bug#24358), Eli Zaretskii, 2016/10/22
- Re: When should ralloc.c be used? (WAS: bug#24358), Paul Eggert, 2016/10/22
- Re: When should ralloc.c be used?, Stefan Monnier, 2016/10/22
- Re: When should ralloc.c be used?, Paul Eggert, 2016/10/22
- Re: When should ralloc.c be used?, Eli Zaretskii, 2016/10/23
- Re: When should ralloc.c be used?, Paul Eggert, 2016/10/23
- Re: When should ralloc.c be used?, Eli Zaretskii, 2016/10/23
- Re: When should ralloc.c be used?, Paul Eggert, 2016/10/23
- Re: When should ralloc.c be used?, Eli Zaretskii, 2016/10/23