Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Created August 25, 2018 13:07
Show Gist options
  • Save dogbert17/23b5e847a19f2798352a44c582760963 to your computer and use it in GitHub Desktop.
Save dogbert17/23b5e847a19f2798352a44c582760963 to your computer and use it in GitHub Desktop.
NQG - Not Quite Golfed
changes
diff --git a/src/gc/collect.h b/src/gc/collect.h
index 123d934..f09303f 100644
--- a/src/gc/collect.h
+++ b/src/gc/collect.h
@@ -1,6 +1,6 @@
/* The maximum size of the nursery area. Note that since it's semi-space
* copying, we could actually have double this amount allocated per thread. */
-#define MVM_NURSERY_SIZE 4194304
+#define MVM_NURSERY_SIZE 32768
/* The nursery size threads other than the main thread start out with. If
* they fill it and trigger a GC run, then it is doubled. If they are
diff --git a/src/gc/debug.h b/src/gc/debug.h
index 1dd4f17..6daf4c9 100644
--- a/src/gc/debug.h
+++ b/src/gc/debug.h
@@ -3,7 +3,7 @@
* 1 = Checks on reference assignments and other relatively cheap cases
* 2 = Checks on every object register access (slow)
*/
-#define MVM_GC_DEBUG 0
+#define MVM_GC_DEBUG 2
#if MVM_GC_DEBUG
#define MVM_ASSERT_NOT_FROMSPACE(tc, c) do { \
example, almost a golf :) a slightly edited version of t/spec/S17-lowlevel/cas-loop.t
use Test;
plan 10;
my class Node {
has $.value;
has $.next;
}
# Make sure we really do it atomic.
for 1..50 -> $attempt {
my $head = Node;
await start {
for 1..1000 -> $i {
cas $head, -> $orig { Node.new(value => $i, next => $orig) }
}
} xx 4;
my $total = 0;
my $cur = $head;
while $cur {
$total += $cur.value;
$cur = $cur.next;
}
is $total, 4 * [+](1..1000),
"Block form of CAS on linked list with lexical head works ($attempt)";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment