MSVC does not support C11 atomics, but it still provides a "stub"
version of stdatomic.h, which aborts compilation with an #error
directive when included.
To avoid this error, explicitly set the C standard to C11 when invoking
the C preprocessor on Windows, and check for the C11 macro
__STDC_NO_ATOMICS__ before including stdatomic.h.
- let the compiler generate type info for the AA Entry and add it to TypeInfo_AssociativeArray
- strip modifiers for index and next in TypeInfo_AssociativeArray to make it agnostic to changes by the glue layer
threads. The `thread_preSuspend` hook should return true when druntime
has knowledge of a thread. But it's based on `sm_this` (the storage for
`Thread.getThis`) being set. Because the thread lock is not taken to set
`sm_this`, a race exists when a thread is suspended between this
setting, and the adding to the thread list for scanning. Therefore,
`thread_preSuspend` can return true, but `thread_scanAll` will not
include that thread in the list of scannables.
The current check that special cases static arrays of void doesn't take
type qualifiers into account - e.g. void[42] is treated as having
indirections, but const(void[42]) is not. This fixes that.
* Add an assert-based segfault handler to `etc.linux.memoryerror`
* Commit memoryAssertError review feedback
* Indent the MemoryErrorSupported version block
* Fix a bad ucontext_t in memoryerror.d
* Fix bad imports in memoryerror.d
* Use a module-scope version: in memoryerror.d
* Add a memoryerror.d unittest
* Prefer version-else-version... in memoryerror.d
* Fix build on i686, arm64 and x86_64+32b multilib for Darwin.
osthread.d needs to import the thread state definitions for each
supported arch (but was only importing x86_64).
NOTE1: Iain Buclaw pointed out that the ucontext import was unused
and do I have removed that too.
NOTE2: I did not add the data for 32bit Arm (as distinct from the
possible use of AArch64/ILP32), because there is no way I know
to test that - since there's no upstream 32b Arm implementation.
NOTE3: The earlier Darwin versions (equivalent to MacOSX 10.5) have
quite limited D support - but both i686 and PowerPC should be able
(at least) to build the druntime.
I tested on x86_64,i686-Darwin17 and aarch64-darwin23.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
* Address code reviews.
---------
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
Co-authored-by: Iain Buclaw <ibuclaw@gdcproject.org>