-
-
Save anonymous/3a98ab6c8792bc84be20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let number = 1024;; | |
let heavy_memory_object = Array.make_matrix 10 1000000 0;; | |
let rec odd n = | |
if (n mod 100) = 0 then Gc.print_stat stdout; | |
if n = 0 then true | |
else if n = 1 then false else even (n - 1) | |
and even n = | |
if n = 0 then false | |
else if n = 1 then true else odd (n - 1);; | |
try | |
let x = Gc.stat() in | |
x.Gc.minor_words; | |
if odd (number) then | |
print_endline ("Odd") | |
else | |
print_endline ("Even") | |
with | |
| _ -> failwith "SHIT WENT WRUNG" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment