shithub: sl

Download patch

ref: dc08975802f87c67ea54a0abdf439ccb9fbf537a
parent: a9612192c386d334f21009b382c0ed8162c88574
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Tue Nov 26 00:36:31 EST 2024

*vm-stats*: print heap total and free

--- a/flisp.c
+++ b/flisp.c
@@ -2102,7 +2102,8 @@
 	USED(args);
 	argcount(nargs, 0);
 	ios_printf(ios_stderr, "nstack        %"PRIu32"\n", FL(nstack));
-	ios_printf(ios_stderr, "heapsize      %"PRIu32"\n", FL(heapsize));
+	ios_printf(ios_stderr, "heap total    %"PRIu32"\n", FL(heapsize));
+	ios_printf(ios_stderr, "heap free     %"PRIu64"\n", (uint64_t)(FL(lim)-FL(curheap)));
 	ios_printf(ios_stderr, "maxfinalizers %"PRIu64"\n", (uint64_t)FL(maxfinalizers));
 	ios_printf(ios_stderr, "gc calls      %"PRIu64"\n", (uint64_t)FL(gccalls));
 	return FL(t);
--