Fixed a segfault when the system can initialise no more pages.
Still not fixed the `member?` bug.
This commit is contained in:
parent
69b199fecd
commit
7d0ce67373
3 changed files with 25 additions and 19 deletions
|
|
@ -65,7 +65,11 @@ struct cons_page *conspages[NCONSPAGES];
|
|||
* that exception would have to have been pre-built.
|
||||
*/
|
||||
void make_cons_page( ) {
|
||||
struct cons_page *result = malloc( sizeof( struct cons_page ) );
|
||||
struct cons_page *result = NULL;
|
||||
|
||||
if ( initialised_cons_pages < NCONSPAGES) {
|
||||
result = malloc( sizeof( struct cons_page ) );
|
||||
}
|
||||
|
||||
if ( result != NULL ) {
|
||||
conspages[initialised_cons_pages] = result;
|
||||
|
|
@ -116,12 +120,10 @@ void make_cons_page( ) {
|
|||
|
||||
initialised_cons_pages++;
|
||||
} else {
|
||||
debug_printf( DEBUG_ALLOC,
|
||||
L"FATAL: Failed to allocate memory for cons page %d\n",
|
||||
initialised_cons_pages );
|
||||
fwide( stderr, 1 );
|
||||
fwprintf( stderr, L"FATAL: Failed to allocate memory for cons page %d\n", initialised_cons_pages );
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue