fix: do not leak when inserting the same page twice, just update
This commit is contained in:
@@ -30,16 +30,14 @@ struct page_entry {
|
||||
struct hash_elem elem; /* An elem for the hash table. */
|
||||
};
|
||||
|
||||
unsigned page_hash (const struct hash_elem *e, void *aux);
|
||||
bool page_less (const struct hash_elem *a_, const struct hash_elem *b_,
|
||||
void *aux);
|
||||
bool init_pages (struct hash *pages);
|
||||
struct page_entry *page_insert_swapped (void *upage, void* kpage,
|
||||
struct thread *owner);
|
||||
struct page_entry *page_insert_file (struct file *file, off_t ofs, void *upage,
|
||||
uint32_t read_bytes, uint32_t zero_bytes,
|
||||
bool writable, enum page_type);
|
||||
struct page_entry *page_get (void *upage);
|
||||
bool page_load_file (struct page_entry *page, bool writable);
|
||||
bool page_load_file (struct page_entry *page);
|
||||
void page_cleanup (struct hash_elem *e, void *aux);
|
||||
|
||||
bool page_in_swap (struct thread *, void *);
|
||||
|
||||
Reference in New Issue
Block a user