From 0e3a795af98b6441d0a9928036e140978511e272 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Sun, 22 May 2016 19:35:10 +0200 Subject: libpager: provide 'pager_create_alloc' Add a variant to 'pager_create' that allocates memory for the user hook next to the pager data increasing locality. * console/pager.c (pager_clear_user_data): Fix type of 'idx', do not free 'upi'. (user_pager_create): Use the new function. * doc/hurd.texi: Document new function. * ext2fs/pager.c (pager_clear_user_data): Don't free 'upi'. (diskfs_get_filemap): Use the new function. * fatfs/pager.c (pager_clear_user_data): Don't free 'upi'. (diskfs_get_filemap): Use the new function. * isofs/pager.c (pager_clear_user_data): Don't free 'upi'. (diskfs_get_filemap): Use the new function. * libpager/pager-create.c (_pager_create): New generic allocation function. (pager_create): Use the new generic function. (pager_create_alloc): New function. * libpager/pager.h (pager_create_alloc): New prototype. --- doc/hurd.texi | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc') diff --git a/doc/hurd.texi b/doc/hurd.texi index 2bcf561b..8428a77b 100644 --- a/doc/hurd.texi +++ b/doc/hurd.texi @@ -1410,6 +1410,11 @@ create references to pagers by use of the relevant ports library functions. On errors, return null and set @code{errno}. @end deftypefun +@deftypefun {struct pager *} pager_create_alloc (@w{size_t @var{u_pager_size}}, @w{struct port_bucket *@var{bucket}}, @w{boolean_t @var{may_cache}}, @w{memory_object_copy_strategy_t @var{copy_strategy}}) +Likewise, but allocate space for the user hook adjacent to the pager +data. +@end deftypefun + Once you are ready to turn over control to the pager library, you should call @code{ports_manage_port_operations_multithread} on the @var{bucket}, using @code{pager_demuxer} as the ports @var{demuxer}. -- cgit v1.2.3