From 4aef86c3e641cbff8e0155589f9cc9172aa1051c Mon Sep 17 00:00:00 2001 From: Moon Flower Date: Mon, 10 Mar 2025 00:11:21 +0330 Subject: New moonshine release! What's changed? > - New allocator based on sbrk and linked lists > - Hybrid allocator switching mechanism to swap sbrk and mmap whenever needed > - Better internal exception detector to prevent useless uninformative stackoverflow exceptions > - Moved a bunch of the code around, as always! > Have a great night! --- main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 8c7585c..2e774b8 100644 --- a/main.c +++ b/main.c @@ -90,11 +90,13 @@ int main() { collect_garbage(true); } else if (current_test == test_minor_features) { - // Minor feature: Custom, better designed float representation - auto x = (struct moonshine_float) { .number = 1234, .decimal = 2 }; - println(x); - // Normal float enhancement - println(12.34); + // Minor feature: sbrk allocator + auto ptr = sbrkocator_alloc(10); + sbrkocator_release(ptr); + ptr = sbrkocator_alloc(1000); + sbrkocator_release(sbrkocator_alloc(500)); + sbrkocator_release(ptr); + puts("Wowie\n"); } else if (current_test == test_garbage_collector_2) { for (u8 i = 0; i < 9999; i++) new (int, 9999); collect_garbage(true); -- cgit v1.2.3