Improved get_free_resource_slot()

Table now tries to expand itself when no available slots are left
This commit is contained in:
2021-04-17 04:59:39 -05:00
parent a28e586139
commit 2a5dcd4a0f
3 changed files with 24 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include "pageallocator.h"
#include "process.h"
#include <stddef.h>
@@ -21,7 +22,7 @@ struct resource_t
struct resource_table_t
{
struct resource_t *array;
size_t capacity;
struct resource_t *limit;
};
int find_resource_slot(struct resource_table_t *table);
int get_free_resource_slot(struct resource_table_t *table, struct page_stack_t *page_stack);