From d3fb717d2d908c8d55b57f84c608b1e4d745ec9f Mon Sep 17 00:00:00 2001 From: hkc Date: Tue, 13 Sep 2022 20:22:56 +0300 Subject: [PATCH] Added error messages when no RAM lol --- .gitignore | 1 + main.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 5099253..98da8a3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.elf +main diff --git a/main.c b/main.c index f04bdad..95d7556 100644 --- a/main.c +++ b/main.c @@ -93,10 +93,12 @@ int main(int argc, char **argv) { OddBlock *block_init(uint64_t start) { OddBlock *blk = calloc(1, sizeof(OddBlock)); if (blk == NULL) { + printf("Failed to allocate a new block: %zd\n", start); n_allocs_failed++; return NULL; } if ((blk->block = malloc(0x1000000)) == NULL) { + printf("Failed to allocate a new block contents: %zd\n", start); free(blk); n_allocs_failed++; return NULL;