mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Use the existing page size in libthr
Rather than calling getpagesize() twice use the value saved after the first call to size a mmap allocation. Reviewed by: kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34983
This commit is contained in:
parent
271f6d52a6
commit
86c500937c
1 changed files with 1 additions and 1 deletions
|
|
@ -158,7 +158,7 @@ _thr_alloc_wake_addr(void)
|
|||
unsigned i;
|
||||
unsigned pagesize = getpagesize();
|
||||
struct wake_addr *pp = (struct wake_addr *)
|
||||
mmap(NULL, getpagesize(), PROT_READ|PROT_WRITE,
|
||||
mmap(NULL, pagesize, PROT_READ|PROT_WRITE,
|
||||
MAP_ANON|MAP_PRIVATE, -1, 0);
|
||||
for (i = 1; i < pagesize/sizeof(struct wake_addr); ++i)
|
||||
pp[i].link = &pp[i+1];
|
||||
|
|
|
|||
Loading…
Reference in a new issue