fix: only use lazy loading if VM flag is enabled

This commit is contained in:
Themis Demetriades
2024-12-04 21:33:21 +00:00
parent 1e236a5c47
commit 723055f485
3 changed files with 69 additions and 4 deletions

View File

@@ -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);