summaryrefslogtreecommitdiff
path: root/coroutine/ucontext/Context.h
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2019-07-16 16:11:55 +1200
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2019-07-18 20:54:55 +1200
commit001f187ed6539f320421d8893d2f3c8f584cc3a5 (patch)
treece525733ca95a920083874cc50ee47084f1e687a /coroutine/ucontext/Context.h
parent385ea910fc28f0e46c72669a260e44d4f3f37d9e (diff)
Make fiber_pool more conservative on platforms with limited address space.
We use COROUTINE_LIMITED_ADDRESS_SPACE to select platforms where address space is 32-bits or less. Fiber pool implementation enables more book keeping, and reduces upper limits, in order to minimise address space utilisation.
Diffstat (limited to 'coroutine/ucontext/Context.h')
-rw-r--r--coroutine/ucontext/Context.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/coroutine/ucontext/Context.h b/coroutine/ucontext/Context.h
index bde9be302a..6cf16c8604 100644
--- a/coroutine/ucontext/Context.h
+++ b/coroutine/ucontext/Context.h
@@ -13,6 +13,10 @@
#define COROUTINE __attribute__((noreturn)) void
+#if INTPTR_MAX <= INT32_MAX
+#define COROUTINE_LIMITED_ADDRESS_SPACE
+#endif
+
struct coroutine_context
{
ucontext_t state;