diff options
| author | 2025-03-10 00:11:21 +0330 | |
|---|---|---|
| committer | 2025-03-10 00:11:21 +0330 | |
| commit | 4aef86c3e641cbff8e0155589f9cc9172aa1051c (patch) | |
| tree | 55d0e6d340ded45737959c3cd94fccceddc550a8 /main.c | |
| parent | Fixed stuff broken woohoo (diff) | |
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!
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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); |
