Commit graph

11 commits

Author SHA1 Message Date
John Ericson
c18911602e Fix boehmgc-coroutine-sp-fallback.diff for FreeBSD
Our FreeBSD headers have `pthread_getattr_np`, but we get a link-time
error that is missing. The good news is that there is another similar
function which does exist, and the upstream project elsewhere does just
the [fallback code] we need.

As the fallback code indicates, the two functions are not identical
however as the other one needs explicit initialization. NetBSD supports
both in fact, and its [manpage] is therefore a good
resource on what the differences are.

[fallback code]: 07a6d0ee88/os_dep.c (L1266-L1272)

[manpage]: https://man.netbsd.org/pthread_attr_get_np.3
2023-09-20 09:04:42 -04:00
Yorick van Pelt
58d24a4cb6 Always disable GC in a coroutine unless the patch is applied 2023-04-07 14:54:38 +02:00
Théophane Hufschmitt
39700c5cbe
Revert "Disable GC during coroutine execution + test" 2023-03-08 20:47:52 +01:00
Yorick van Pelt
176005749c
Always disable GC in a coroutine unless the patch is applied 2023-03-01 15:07:00 +01:00
Robert Hensing
46054f932b Update boehmgc-coroutine-sp-fallback.diff 2023-01-24 15:11:55 +01:00
Robert Hensing
0664ba0a67 Revert "fixup: remove boehmgc patch"
It is still necessary.
Please do your research, or f ask the author, which happens to be me.

An evaluator like this is not an environment where "it compiles, so
it works" will ever hold.

This reverts commit 1c40182b12.
2023-01-24 14:39:45 +01:00
Linus Heckemann
1c40182b12 fixup: remove boehmgc patch 2022-12-19 13:35:05 +01:00
Matthew Bauer
f4d7208e23 Update boehmgc-coroutine-sp-fallback.diff for darwin
The darwin_stop_world implementation is slightly different. sp goes to
altstack_lo instead of lo in this case. Assuming that is an
implementation detail.

But the fix is the same, when we detect alstack_lo outside of the
expected stack range, we reset it to hi - stack_limit.

Here stack_limit is calculated with pthread_get_stacksize_np since
that is the BSD equivalent to pthread_attr_getstacksize.
2022-09-01 11:48:50 -05:00
Moritz Hedtke
6f291ed718
Fix leaking pthread_attr_t
pthread_attr_destroy was not called.
2021-11-03 22:54:16 +01:00
Robert Hensing
5c58d84a76 boehmgc: Remove unused code from patch 2021-06-25 17:45:48 +02:00
Robert Hensing
57409244ec boehmgc: Crude support for coroutines
Fixes the problem where a stack pointer outside the original
thread causes the collector to crash.

It could be made more accurate by recording the stack pointer
every time we switch to a coroutine. We can use this information
to update our own coroutine stacks like normal data. When the
stack pointer is on a thread, we can add a field to GC_thread
"fallback_sp" to be used when the thread sp is outside the original
thread range.
2021-06-24 18:17:03 +02:00