aboutsummaryrefslogtreecommitdiff
path: root/src/mem
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-08-29 22:42:09 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2025-08-29 22:42:09 +0300
commitda2c88e13f1ef6576a5afa1b671f75973435caf3 (patch)
tree31e7539115899a79a9094ac3191cffff36623e9b /src/mem
parent260689ea747f93b018ec4a25a2526a7aa05b7cb0 (diff)
downloadgran-da2c88e13f1ef6576a5afa1b671f75973435caf3.tar.gz
gran-da2c88e13f1ef6576a5afa1b671f75973435caf3.zip
bump conts
Diffstat (limited to 'src/mem')
-rw-r--r--src/mem/ideal_alloc.c10
-rw-r--r--src/mem/simple_mem.c1
2 files changed, 4 insertions, 7 deletions
diff --git a/src/mem/ideal_alloc.c b/src/mem/ideal_alloc.c
index 8840a17..094758b 100644
--- a/src/mem/ideal_alloc.c
+++ b/src/mem/ideal_alloc.c
@@ -187,14 +187,12 @@ struct component *create_ideal_alloc(uint64_t max_spaces)
{
struct alloc *a = calloc(1, sizeof(struct alloc));
a->spaces = spaces_create(max_spaces);
- if (spaces_uninit(&a->spaces)) {
- free(a);
- return NULL;
- }
-
for (size_t i = 0; i < max_spaces; ++i) {
struct space space = create_space();
- spaces_append(&a->spaces, space);
+ if (!spaces_append(&a->spaces, space)) {
+ spaces_destroy(&a->spaces);
+ return NULL;
+ }
}
a->max_spaces = max_spaces;
diff --git a/src/mem/simple_mem.c b/src/mem/simple_mem.c
index 48a4631..d52c0f4 100644
--- a/src/mem/simple_mem.c
+++ b/src/mem/simple_mem.c
@@ -6,7 +6,6 @@
#include <stdbool.h>
#include <gran/mem/simple_mem.h>
-#include <gran/torus3d/node.h>
struct simple_mem {
struct component component;