fix: only use lazy loading if VM flag is enabled
This commit is contained in:
@@ -259,14 +259,19 @@ thread_create (const char *name, int priority,
|
||||
return TID_ERROR;
|
||||
}
|
||||
|
||||
#define USERPROG
|
||||
#ifdef USERPROG
|
||||
/* Initialize the thread's file descriptor table. */
|
||||
t->fd_counter = MINIMUM_USER_FD;
|
||||
|
||||
if (!hash_init (&t->open_files, fd_hash, fd_less, NULL)
|
||||
|| !hash_init (&t->child_results, process_result_hash,
|
||||
process_result_less, t)
|
||||
|| !hash_init (&t->pages, page_hash, page_less, NULL))
|
||||
bool success = hash_init (&t->open_files, fd_hash, fd_less, NULL);
|
||||
success = success && hash_init (&t->child_results, process_result_hash,
|
||||
process_result_less, t);
|
||||
#ifdef VM
|
||||
success = success && hash_init (&t->pages, page_hash, page_less, NULL);
|
||||
#endif
|
||||
|
||||
if (!success)
|
||||
{
|
||||
palloc_free_page (t);
|
||||
free (t->result);
|
||||
|
||||
Reference in New Issue
Block a user