emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs-26 threads problem [win64]


From: Eli Zaretskii
Subject: Re: Emacs-26 threads problem [win64]
Date: Sun, 15 Oct 2017 20:19:28 +0300

> From: Stefan Monnier <address@hidden>
> Date: Sun, 15 Oct 2017 12:41:18 -0400
> 
> >> The malloc() and calloc() functions return a pointer to  the  allocated
> >> memory,  which  is  suitably  aligned for any built-in type.
>                                             ^^^^^
> This implies it has to be at least aligned with max_align_t
> IOW apparently on 64bit Windows malloc will return an object aligned on
> a 16B boundary.

I think you are right, as MSDN says about malloc:

  The storage space pointed to by the return value is guaranteed to be
  suitably aligned for storage of any type of object that has an
  alignment requirement less than or equal to that of the fundamental
  alignment. (In Visual C++, the fundamental alignment is the
  alignment that's required for a double, or 8 bytes. In code that
  targets 64-bit platforms, it’s 16 bytes.)

So I guess this is the basis for GCC to assume 16-byte alignment.

Thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]