Commit graph

569 commits

Author SHA1 Message Date
Iain Buclaw
5c47e5cdc6 druntime: Add version(GNU) imports to rt.deh and sections modules 2025-01-19 11:30:20 +01:00
Iain Buclaw
37dddf5dd0 druntime: Add version(GNU) definitions of c_long and c_ulong 2025-01-19 11:28:34 +01:00
Jonas Meeuws
8c5051803a
Use selective imports when importing from core.stdc in core.internal (#20723) 2025-01-19 09:45:13 +08:00
Jonas Meeuws
d115713410
Add an assert-based segfault handler to etc.linux.memoryerror (#20643)
* 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
2025-01-18 22:38:54 +01:00
Jonas Meeuws
e49b67e969
Remove usage of obsolete _fdToHandle in rt/dmain2.d (#20722) 2025-01-18 22:38:22 +01:00
0-v-0
9c9720493d
Use number suffix instead of cast (#20729) 2025-01-18 22:31:58 +01:00
Jonas Meeuws
c71c3b231d
Use selective imports when importing from core.stdc in core (#20725) 2025-01-17 15:20:47 +01:00
Iain Sandoe
f224123e56
Fix build on i686, arm64 and x86_64+32b multilib for Darwin. (#20710)
* 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>
2025-01-16 22:35:06 +08:00
Nicholas Wilson
93ca4676b6
Merge pull request #20698 from schveiguy/gcfinalizerarrays
Move all array and finalizer functionality into the GC
2025-01-15 06:27:36 +08:00
Steven Schveighoffer
ed08053424 fix translation of nested array construction length. 2025-01-14 15:20:09 -05:00
Steven Schveighoffer
4f93c2a1a2 Trying to "fix" obvious non-deterministic test. 2025-01-14 14:21:29 -05:00
Steven Schveighoffer
6b914aef11 Zero out padding for 32-bit systems for large blocks. 2025-01-14 11:14:53 -05:00
Steven Schveighoffer
76fb1c03f2 Fix issue with appending zero items to an array that was previously
handled by allocating an empty array with metadata!
2025-01-14 10:20:55 -05:00
Steven Schveighoffer
d370a117b4 Remove almost all blockmeta/cache functionality from rt, using the GC
API instead.
2025-01-14 09:49:03 -05:00
Walter Bright
d6f693b46a
fix #20516 ImportC undefined identifier _Float16 (#20699) 2025-01-14 15:14:28 +08:00
0-v-0
b2c4f89d53 Remove redundant else 2025-01-14 08:11:48 +01:00
Steven Schveighoffer
b711f1ac89 Fix custom_gc to avoid alignment issues on platforms where alignment
matters.
2025-01-13 20:29:49 +01:00
Nicholas Wilson
4ad3fc7942
Fix #20691 - Add SO_REUSEPORT for Solaris (#20692) 2025-01-13 20:06:12 +08:00
Nicholas Wilson
6455cb27ef
Fix #20688 SO_REUSEPORT not defined (#20689) 2025-01-13 16:38:19 +08:00
0-v-0
0ee5b318b3 Remove redundant else 2025-01-11 17:09:54 +08:00
Iain Buclaw
126064282f core.builtins: Fix return value of likely/unlikely
For both GCC and LLVM, `__builtin_expect` and `llvm_expect` respectively
return an integer, not a boolean. This triggers a compiler error as
implicit narrow conversions are not allowed.
2025-01-11 07:48:33 +08:00
Dennis
eb910dc865
Make likely and unlikely templates (#20680) 2025-01-10 23:57:03 +01:00
Dennis
e9ae684df5
Merge pull request #20663 from Reavershark/fix-late-linux-version
Place the `version(linux):` in `core.sys.linux.sys.procfs` higher.
2025-01-08 23:28:44 +01:00
Jonas Meeuws
21af76d40d
Place the version(linux): in core.sys.linux.sys.procfs higher. 2025-01-08 21:49:00 +01:00
Jonas Meeuws
5b39097ef8
Fix building druntime with all -debug= flags on non-linux-amd64 platforms 2025-01-08 21:24:25 +01:00
Jonas Meeuws
b985f8cb3a
Fix building druntime with all other -debug= flags 2025-01-08 21:24:25 +01:00
Jonas Meeuws
9d978fddb9
Fix building druntime with -debug=PRINTF 2025-01-08 21:24:25 +01:00
Jonas Meeuws
999454ec91
Replace remaining github links with $(DRUNTIMESRC) in module ddocs 2025-01-08 15:20:17 +01:00
Jonas Meeuws
c0fb282be9
Use selective imports when importing platform-specific modules (core.sys) (#20632) 2025-01-08 08:57:39 +08:00
Jonas Meeuws
9c350031c7
Fix invalid "Source: " links in druntime module ddocs 2025-01-07 10:54:00 +01:00
Steven Schveighoffer
bc773a3369
Update docs for new gc array interface. (#20633) 2025-01-05 18:51:10 +08:00
Elias Batek
1a15d20a8a
Prevent core.internal.traits.AliasSeq from bleeding through core.time (#20638)
Workaround for:

- <https://github.com/dlang/dmd/issues/18223>
- <https://github.com/dlang/phobos/issues/10610>
2025-01-05 18:50:19 +08:00
Steven Schveighoffer
caad83f773 Add GC handling of metadata based on passed in typeinfo and bits. 2025-01-04 23:33:45 -05:00
0-v-0
fc52dc008f Remove redundant attribute 2025-01-04 20:15:31 +08:00
Nicholas Wilson
1fa6c0a960
[gcinterface.d] fix documentation Params: (#20625) 2024-12-31 12:57:35 +08:00
Steven Schveighoffer
b88ffc50d7
Update GC interface to contain array management functions. (#20608)
* Move array functions into conservative GC.

* Move array functions into conservative GC. Implement stubs for manual GC
and proto GC.

* Add note about trusted functions
2024-12-30 11:04:33 +08:00
Jonathan M Davis
b2c83e9921 Fix #20603.
hasIndirections does not take enums into account, whereas if an enum's
base type has indirections, then clearly, the enum type does as well.
2024-12-26 04:41:35 +01:00
Jonathan M Davis
e7d058bcff Fix #20601.
hasIndirections doesn't handle static arrays of length 0 correctly (they
don't actually have any indirections), because operator precedence
resulted in the check for 0 length static arrays having no actual
effect.

I also copied the test for
https://issues.dlang.org/show_bug.cgi?id=12000 from std.traits to here,
because it's really a compiler bug that's being tested rather than
hasIndirections itself (so being in the compiler repo arguably makes
more sense), and it also arguably makes more sense to put it next to the
actual implementation than in std.traits where it's been.
2024-12-25 12:40:31 -07:00
Nicholas Wilson
6963395dc1
Merge pull request #20586 from schveiguy/addarrayops
rework common array operations into functions that can be migrated to the GC
2024-12-23 12:21:47 +08:00
Steven Schveighoffer
7768d2730a Undo removal of unittest, now fetch the attributes from existing block
if we are reallocating. This is a bit slower but keeps the same behavior
(which I still think is wrong).
2024-12-22 20:38:11 -05:00
Steven Schveighoffer
8b3db9998a Use new functions when managing arrays from rt.lifetime. 2024-12-21 23:32:17 -05:00
0-v-0
1fd2fdb84b
Mark windows api nothrow @nogc (#17498) 2024-12-11 14:51:16 +08:00
Steven Schveighoffer
d74bee4083 Add new abstract functions to deal with array operations. These will be moved to
the GC in a future PR.
2024-12-09 22:19:05 -05:00
Nicholas Wilson
58a0ef7f52 Fix #17214 - Add O_NOFOLLOW for Mac OS 2024-12-09 22:46:59 +01:00
Nick Treleaven
2674d225aa
[core.builtins] Improve docs for trap, likely, unlikely (#17491)
Based on: https://github.com/dlang/dmd/edit/master/changelog/druntime.expect-trap.dd
2024-12-08 14:32:57 +08:00
Nicholas Wilson
06e8c8d3dd
Fix #17479 - Wrong signature for core.sys.windows.winuser.GetMessageExtraInfo (#17493) 2024-12-08 12:05:29 +08:00
0-v-0
a8e1ea6a4a Mark windows api nothrow @nogc 2024-12-07 02:18:42 +01:00
Dennis Korpel
74c40e9be0 Merge branch 'stable' into master 2024-11-29 12:46:40 +01:00
Richard (Rikki) Andrew Cattermole
6567f6f4a4 Fix bugzilla issue 24882 - COM class is allocated using GC not malloc 2024-11-29 08:37:07 +01:00
Paul Backus
4c645bbaf9 Fix Bugzilla 24872 - Assigning non-copyable value to array has no effect 2024-11-23 05:51:02 +08:00