aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Moon Flower <moon@coffin.ir> 2025-03-10 00:15:21 +0330
committerGravatar Moon Flower <moon@coffin.ir> 2025-03-10 00:15:21 +0330
commitfdcda0816a4f117a42eb3666dbc50f989bb26063 (patch)
tree5ac4964a09258c74b2005a2ff4c182eb2aabd222
parentNew 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!
-rw-r--r--Makefile1
-rw-r--r--moonshine.h10
2 files changed, 2 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index a763c2a..c69c23b 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ all: m4 c test
clean:
rm -rf out.*
rm -rf *.m4.h
+ rm -rf perf.data*
m4:
m4 moonshine.m4 > moonshine.m4.h
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;