summary refs log tree commit diff stats
path: root/lib/system.nim
diff options
context:
space:
mode:
authorStefan Talpalaru <stefantalpalaru@yahoo.com>2015-06-16 15:15:17 +0200
committerStefan Talpalaru <stefantalpalaru@yahoo.com>2015-06-16 15:15:17 +0200
commitb487d4e42501fa5d1ef8f589a0cd89c187d09fc3 (patch)
tree2cd2ae83f43496b8035772b43d225822a98cf246 /lib/system.nim
parent8624654c57cd55e49a6d64cc66cb8657dfe9e86d (diff)
downloadNim-b487d4e42501fa5d1ef8f589a0cd89c187d09fc3.tar.gz
conditional TGenericSeq extension
Diffstat (limited to 'lib/system.nim')
-rw-r--r--lib/system.nim10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 5d723bed3..2beb5b88d 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -304,7 +304,9 @@ const ArrayDummySize = when defined(cpu16): 10_000 else: 100_000_000
 when not defined(JS):
   type
     TGenericSeq {.compilerproc, pure, inheritable.} = object
-      len, reserved, elemSize: int
+      len, reserved: int
+      when defined(gogc):
+        elemSize: int
     PGenericSeq {.exportc.} = ptr TGenericSeq
     UncheckedCharArray {.unchecked.} = array[0..ArrayDummySize, char]
     # len and space without counting the terminating zero:
@@ -2682,8 +2684,10 @@ when not defined(JS): #and not defined(NimrodVM):
   when not defined(NimrodVM):
     include "system/sets"
 
-    const
-      GenericSeqSize = (3 * sizeof(int))
+    when defined(gogc):
+      const GenericSeqSize = (3 * sizeof(int))
+    else:
+      const GenericSeqSize = (2 * sizeof(int))
 
     proc getDiscriminant(aa: pointer, n: ptr TNimNode): int =
       sysAssert(n.kind == nkCase, "getDiscriminant: node != nkCase")