summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sysdep/unix/alloc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sysdep/unix/alloc.c b/sysdep/unix/alloc.c
index 2205f152..891a0e69 100644
--- a/sysdep/unix/alloc.c
+++ b/sysdep/unix/alloc.c
@@ -282,10 +282,13 @@ page_cleanup(void *_ UNUSED)
if (!empty_pages || (empty_pages->pos == EP_POS_MAX))
{
/* There is either no pointer block or the last block is full. We use this block as a pointer block. */
- empty_pages = (struct empty_pages *) fp;
- UNPROTECT_PAGE(empty_pages);
- *empty_pages = (struct empty_pages) {};
- PROTECT_PAGE(empty_pages);
+ struct empty_pages *ep = (struct empty_pages *) fp;
+ UNPROTECT_PAGE(ep);
+ *ep = (struct empty_pages) {
+ .next = empty_pages,
+ };
+ PROTECT_PAGE(ep);
+ empty_pages = ep;
}
else
{