[gcc(refs/users/ibuclaw/heads/darwin)] libphobos: Fix broken ucontext implementation, and other small test fixes
Iain Buclaw
ibuclaw@gcc.gnu.org
Sun Mar 14 22:00:56 GMT 2021
https://gcc.gnu.org/g:20170842858f4e205844cfb121f0a9092d8e4717
commit 20170842858f4e205844cfb121f0a9092d8e4717
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date: Wed Dec 9 10:49:34 2020 +0100
libphobos: Fix broken ucontext implementation, and other small test fixes
Diff:
---
libphobos/libdruntime/core/thread/fiber.d | 1 +
libphobos/libdruntime/core/thread/threadbase.d | 1 +
libphobos/src/std/experimental/allocator/package.d | 3 ++-
libphobos/testsuite/libphobos.thread/fiber_guard_page.d | 6 ++++--
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/libphobos/libdruntime/core/thread/fiber.d b/libphobos/libdruntime/core/thread/fiber.d
index 3270f2e7094..2b475ca82cb 100644
--- a/libphobos/libdruntime/core/thread/fiber.d
+++ b/libphobos/libdruntime/core/thread/fiber.d
@@ -883,6 +883,7 @@ class Fiber
*/
static Fiber getThis() @safe nothrow @nogc
{
+ version (GNU) pragma(inline, false);
return sm_this;
}
diff --git a/libphobos/libdruntime/core/thread/threadbase.d b/libphobos/libdruntime/core/thread/threadbase.d
index c2c2333efe9..50795e444be 100644
--- a/libphobos/libdruntime/core/thread/threadbase.d
+++ b/libphobos/libdruntime/core/thread/threadbase.d
@@ -313,6 +313,7 @@ class ThreadBase
// NOTE: This function may not be called until thread_init has
// completed. See thread_suspendAll for more information
// on why this might occur.
+ version (GNU) pragma(inline, false);
return sm_this;
}
diff --git a/libphobos/src/std/experimental/allocator/package.d b/libphobos/src/std/experimental/allocator/package.d
index 11c85474365..7c404070ffa 100644
--- a/libphobos/src/std/experimental/allocator/package.d
+++ b/libphobos/src/std/experimental/allocator/package.d
@@ -622,7 +622,8 @@ allocator can be cast to $(D shared).
testAllocatorObject(processAllocator);
testAllocatorObject(theAllocator);
- assertThrown!AssertError(processAllocator = null);
+ // XBUG: Asserts are not thrown in release code, so is a pointless check.
+ //assertThrown!AssertError(processAllocator = null);
// Restore initial processAllocator state
processAllocator = oldProcessAllocator;
diff --git a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
index 9f754e155d2..ca54a19857f 100644
--- a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
+++ b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
@@ -1,13 +1,15 @@
// { dg-options "-O0" }
// { dg-shouldfail "segv or bus error" }
import core.thread;
+import core.sys.posix.signal;
import core.sys.posix.sys.mman;
// this should be true for most architectures
// (taken from core.thread)
-version = StackGrowsDown;
+version (GNU_StackGrowsDown)
+ version = StackGrowsDown;
-enum stackSize = 4096;
+enum stackSize = MINSIGSTKSZ;
// Simple method that causes a stack overflow
void stackMethod()
More information about the Gcc-cvs
mailing list