Added error messages when no RAM lol
This commit is contained in:
parent
06b5c3016f
commit
d3fb717d2d
|
@ -1 +1,2 @@
|
|||
*.elf
|
||||
main
|
||||
|
|
2
main.c
2
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;
|
||||
|
|
Loading…
Reference in New Issue