Danny Milosavljevic writes:

Hi Danny, Grishka!

> On Fri, 08 Jan 2021 08:16:29 +0100
> grischka <gris...@gmx.de> wrote:
>
>> But no such thing happens in this case.  The 'ptr' in init_putv()
>> comes from
>> 
>>          ptr = sec->data + c;
>> 
>> and it seems that if tcc is doing the right thing then 'c' cannot
>> be misaligned, and if malloc/realloc on that system is doing the
>> right thing,  then sec->data cannot be misaligned either.  So...?
>
> How does tcc allocate dynamic memory?  I've tried to find out, but
> tcc_malloc is defined to be "use_tcc_malloc", which I don't find
> anywhere.  Does it use libc malloc for that ?
>
> (With MEM_DEBUG defined, tcc_malloc_debug seems to use malloc.  But
> what about without MEM_DEBUG defined ?)
>
> If so, is libc malloc supposed to ensure alignment of allocated memory?
>
> According to https://man7.org/linux/man-pages/man3/malloc.3.html yes.
>
> @Janneke: So our mes libc malloc should be aligning the stuff--but it's not
> doing it.  So it's a bug in our libc.

Beautiful!  Maybe this explains other differences we saw between
aarch64-linux and arm-linux?

Greetings,
Janneke

-- 
Jan Nieuwenhuizen <jann...@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com

Reply via email to