about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-12-18 14:40:15 -0800
committerBrian Anderson <banderson@mozilla.com>2011-12-18 15:23:41 -0800
commit74d5faa86e1bd1fc678ae3e5aee49e8445470002 (patch)
treed3c0cad13201eab2b639458c1a9c10397c1fc903 /src/rt/rust_task.cpp
parent762d7e43a6594beb839e1c7020935b561e2d9ae5 (diff)
downloadrust-74d5faa86e1bd1fc678ae3e5aee49e8445470002.tar.gz
rust-74d5faa86e1bd1fc678ae3e5aee49e8445470002.zip
rt: Give each platform its own red zone definition
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 3cb553bcd7b..1a1a26fe73d 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -18,12 +18,35 @@
 // The amount of extra space at the end of each stack segment, available
 // to the rt, compiler and dynamic linker for running small functions
 // FIXME: We want this to be 128 but need to slim the red zone calls down
+#define RZ_LINUX_32 1024*20
+#define RZ_LINUX_64 1024*20
+#define RZ_MAC_32   1024*20
+#define RZ_MAC_64   1024*20
+#define RZ_WIN_32   1024*20
+
+#ifdef __linux__
 #ifdef __i386__
-#define RED_ZONE_SIZE 1024*20
+#define RED_ZONE_SIZE RZ_LINUX_32
+#endif
+#ifdef __x86_64__
+#define RED_ZONE_SIZE RZ_LINUX_64
+#endif
+#endif
+#ifdef __APPLE__
+#ifdef __i386__
+#define RED_ZONE_SIZE RZ_MAC_32
 #endif
-
 #ifdef __x86_64__
-#define RED_ZONE_SIZE 1024*20
+#define RED_ZONE_SIZE RZ_MAC_64
+#endif
+#endif
+#ifdef __WIN32__
+#ifdef __i386__
+#define RED_ZONE_SIZE RZ_WIN_32
+#endif
+#ifdef __x86_64__
+#define RED_ZONE_SIZE RZ_WIN_64
+#endif
 #endif
 
 // Stack size