| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Unlike mmap () and calloc (), reallocarray () does not automatically
zero-fill the newly allocated memory. Do so explicitly.
Message-Id: <CAN9u=Hd21Es7Kc4tVBAUeLaKo9CWKO1e577TqnXMzmmvwLi22Q@mail.gmail.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* pagemap.c (_pager_pagemap_resize): Use mmap instead of vm_allocate.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
Return errors.
|
| |
|
| |
|
| |
|
|
|