CHECKP: semi-stable vfs

This commit is contained in:
boreddevnl
2026-04-11 23:08:33 +02:00
parent 5933483009
commit 38ed0b5ffa
6 changed files with 704 additions and 456 deletions

View File

@@ -709,7 +709,13 @@ static void explorer_load_directory(Window *win, const char *path) {
if (!entries) return;
int count = vfs_list_directory(path, entries, capacity);
// Trace string to see if we reached here
extern void serial_write(const char*); extern void serial_write_num(uint32_t);
serial_write("[EXPLORER] load_directory: "); serial_write(path); serial_write(" | loop start. count: "); serial_write_num(count); serial_write("\n");
while (count == capacity) {
serial_write("[EXPLORER] Doubling capacity to: "); serial_write_num(capacity * 2); serial_write("\n");
capacity *= 2;
vfs_dirent_t *new_entries = (vfs_dirent_t*)krealloc(entries, capacity * sizeof(vfs_dirent_t));
if (!new_entries) { kfree(entries); return; }
@@ -717,6 +723,8 @@ static void explorer_load_directory(Window *win, const char *path) {
count = vfs_list_directory(path, entries, capacity);
}
serial_write("[EXPLORER] load_directory loop complete.\n");
if (state->items_capacity < count) {
int new_cap = count < EXPLORER_INITIAL_CAPACITY ? EXPLORER_INITIAL_CAPACITY : count;
ExplorerItem *new_items = (ExplorerItem*)krealloc(state->items, new_cap * sizeof(ExplorerItem));