diff options
| author | 2025-03-10 00:15:21 +0330 | |
|---|---|---|
| committer | 2025-03-10 00:15:21 +0330 | |
| commit | fdcda0816a4f117a42eb3666dbc50f989bb26063 (patch) | |
| tree | 5ac4964a09258c74b2005a2ff4c182eb2aabd222 /moonshine.h | |
| parent | New moonshine release! What's changed? (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 'moonshine.h')
| -rw-r--r-- | moonshine.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/moonshine.h b/moonshine.h index d3a8293..1eddf5f 100644 --- a/moonshine.h +++ b/moonshine.h @@ -993,7 +993,6 @@ __attribute__((diagnose_as_builtin(__builtin_malloc, 1))) __attribute__((malloc) static int alloc_count = 0; if (unlikely(alloc_count++ == 4096)) { alloc_count = 0; - // mmapocator_collect_garbage(false); mmapocator_clean_pages(); } @@ -1073,9 +1072,6 @@ ABYSS:; return (var) new_location; } -// TODO: find_pointer only handles absolute pointers, whilst mine() needs to handle forward-facing pointers as well, which have -// been altered by pointer arithmetic. - // Finds a pointer's reference in the page table. struct FoundPointer mmapocator_find_pointer(const var addr, bool throw_on_error) { for (u8 i = 0; i < global_page_table.size; i++) { @@ -1146,8 +1142,6 @@ var first_break = NULL; typedef __PTRDIFF_TYPE__ ptrdiff_t; -// TODO: Prevent sbrk from requesting more brk space if the value is less than an increment of 1024. - const u8 sbrk_increment = 4096; fn_overload var sbrk(u8 increment) { if (current_break == NULL) { @@ -1337,7 +1331,7 @@ __attribute__((diagnose_as_builtin(__builtin_realloc, 1, 2))) var remap(const va return new_ptr; } -// Check if the current process tree owns a pointer. Expensive, use it +// Check if the current process tree owns a pointer. Expensive, don't use it often. bool mine(const ptr pointer) { if (pointer == NULL) return false; @@ -2263,8 +2257,6 @@ __attribute__((force_align_arg_pointer)) __attribute__((naked)) void _start(void "hlt \n"); } -// TODO: Check for errors - typedef long ssize_t; typedef long off_t; |
