aboutsummaryrefslogtreecommitdiff
path: root/libpager/pagemap.c
Commit message (Collapse)AuthorAgeFilesLines
* libpager: Properly zero-initialize pagemapSergey Bugaev2021-05-071-0/+2
| | | | | | Unlike mmap () and calloc (), reallocarray () does not automatically zero-fill the newly allocated memory. Do so explicitly. Message-Id: <CAN9u=Hd21Es7Kc4tVBAUeLaKo9CWKO1e577TqnXMzmmvwLi22Q@mail.gmail.com>
* libpager: Use libc heap for pagemapSergey Bugaev2021-05-071-17/+9
| | | | | | | | | libc already implements the functionality for allocating and managing memory blocks like the pagemap. Using libc functions gives us some additional niceties like overflow checking in reallocarray (). it also means that we will not allocate a whole page of memory if we need to store just a few integers. Message-Id: <20210506125631.79117-7-bugaevc@gmail.com>
* libpager: Fix overallocating pagemapSergey Bugaev2021-05-071-4/+5
| | | | | | | | The code tried to round up the allocation size to a multiple of page size. But we actually allocate newsize * sizeof (*p->pagemap) bytes, not newsize bytes, which meant allocations were sizeof (*p->pagemap) times larger than they needed to be. Message-Id: <20210506125631.79117-6-bugaevc@gmail.com>
* libpager: Store pagemapsize as vm_size_tSergey Bugaev2021-05-061-1/+1
| | | | | | On a 64-bit system, there can be a lot more pages than a 32-bit int can fit. Message-Id: <20210506125631.79117-5-bugaevc@gmail.com>
* Replace `bcopy' with `memcpy' or `memmove' as appropriateJustus Winter2014-12-101-1/+1
| | | | | | | | | | | | | | | | | | | * ext2fs/inode.c: Replace `bcopy' with `memcpy' or `memmove' as appropriate. * ext2fs/pager.c: Likewise. * isofs/lookup.c: Likewise. * isofs/main.c: Likewise. * isofs/rr.c: Likewise. * libdiskfs/file-get-trans.c: Likewise. * libiohelp/return-buffer.c: Likewise. * libpager/pagemap.c: Likewise. * libpipe/pq.c: Likewise. * libpipe/pq.h: Likewise. * libstore/unzipstore.c: Likewise. * mach-defpager/default_pager.c: Likewise. * pfinet/ethernet.c: Likewise. * pfinet/tunnel.c: Likewise. * storeio/dev.c: Likewise.
* 2000-07-25 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell2000-07-251-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | * priv.h (PM_WRITEWAIT): New pagemap bit. * data-return.c (_pager_do_write_request): Don't proceed with a pageout if one is already in progress. Once we finish, wake up any potential PM_WRITEWAIT waiters. * priv.h (PM_INIT): Provide value again. * data-return.c (_pager_do_write_request): Track PM_INIT again. * priv.h (struct pager): Make pagemap consist of 16-bit elements instead of only 8 bits. * data-request.c (_pager_seqnos_memory_object_data_request): Make PM_ENTRY a short pointer. * data-return.c (_pager_do_write_request): Make PM_ENTRIES a short pointer. * lock-object.c (_pager_lock_object): Make PM_ENTRIES a short pointer. * mark-error.c (_pager_mark_next_request_error): Make P a short pointer. (_pager_mark_object_error): Likewise. * offer-page.c (pager_offer_page): Make PM_ENTRY a short pointer. * object-terminate.c (_pager_free_structure): Interpret pagemapsize correctly. * pagemap.c (_pager_pagemap_resize): Likewise.
* 1999-07-09 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell1999-07-111-1/+2
| | | | * pagemap.c (_pager_pagemap_resize): Use mmap instead of vm_allocate.
* 1999-07-03 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell1999-07-031-2/+2
| | | | | | | | | | * data-return.c (_pager_do_write_request): Use munmap instead of vm_deallocate. * object-terminate.c (_pager_free_structure): Likewise. * pagemap.c (_pager_pagemap_resize): Likewise. * pager-memcpy.c (pager_memcpy): Likewise. * pager.h (pager_write_page): Doc adjustment.
* (_pager_pagemap_resize):Miles Bader1997-02-121-15/+21
| | | | Return errors.
* entered into RCSMichael I. Bushnell1994-01-251-1/+1
|
* Formerly pagemap.c.~3~Michael I. Bushnell1994-01-221-2/+2
|
* Formerly pagemap.c.~2~Michael I. Bushnell1994-01-191-3/+2
|
* Initial revisionMichael I. Bushnell1994-01-131-0/+40