From 9fec21dc21b93c74158e577bc1a02685f97904d2 Mon Sep 17 00:00:00 2001 From: nilsbecker Date: Mon, 24 Nov 2014 23:52:09 +0100 Subject: [PATCH 1/3] eliminate some weak array creations the idea was to save on gc load by letting weak arrays expire by themselves test.ml passes. the non-emptyness of the arrays above Wa.len does not seem to be a problem --- src/react.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/react.ml b/src/react.ml index 5742398..b8af5f3 100644 --- a/src/react.ml +++ b/src/react.ml @@ -20,7 +20,7 @@ module Wa = struct For now the arrays only grow. We could try to compact and downsize the array in scan_add if a threshold of empty slots is exceeded. *) - +jddu let create size = { arr = Weak.create size; len = 0 } let length a = a.len let is_empty a = @@ -31,7 +31,7 @@ module Wa = struct true with Exit -> false - let clear a = a.arr <- Weak.create 0; a.len <- 0 + let clear a = a.len <- 0 let get a i = Weak.get a.arr i let set a i = Weak.set a.arr i let swap a i i' = @@ -300,7 +300,7 @@ module Step = struct (* Update steps. *) let rec execute c = let eops c = List.iter (fun op -> op ()) c.eops; c.eops <- [] in let cops c = List.iter (fun op -> op ()) c.cops; c.cops <- [] in - let finish c = c.over <- true; c.heap <- Wa.create 0 in + let finish c = c.over <- true; Wa.clear c.heap in let rec update c = match H.take c.heap with | Some n when n.rank <> delayed_rank -> n.update c; update c | Some n -> From f88a6eda68acdbff53f3729cbc635ae911056a0a Mon Sep 17 00:00:00 2001 From: nilsbecker Date: Tue, 25 Nov 2014 00:03:34 +0100 Subject: [PATCH 2/3] Update react.ml --- src/react.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/react.ml b/src/react.ml index b8af5f3..6399407 100644 --- a/src/react.ml +++ b/src/react.ml @@ -20,7 +20,7 @@ module Wa = struct For now the arrays only grow. We could try to compact and downsize the array in scan_add if a threshold of empty slots is exceeded. *) -jddu + let create size = { arr = Weak.create size; len = 0 } let length a = a.len let is_empty a = From c289e0da0016da6fa60a865155372bda4b92ddfe Mon Sep 17 00:00:00 2001 From: nbecker Date: Sun, 1 Feb 2015 20:02:46 +0100 Subject: [PATCH 3/3] ignore executables and swap files --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f825403..f5e9804 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ _build tmp *~ \#*# -CLOCK.org \ No newline at end of file +CLOCK.org +*.native +*.o +*.swp