[Git][ghc/ghc][master] rts/m32: Fix sanity checking

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Fri Dec 23 04:41:59 UTC 2022



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
14b2e3d3 by Ben Gamari at 2022-12-22T23:41:42-05:00
rts/m32: Fix sanity checking

Previously we would attempt to clear pages which were marked as
read-only. Fix this.

- - - - -


1 changed file:

- rts/linker/M32Alloc.c


Changes:

=====================================
rts/linker/M32Alloc.c
=====================================
@@ -286,13 +286,13 @@ m32_release_page(struct m32_page_t *page)
 
   const size_t pgsz = getPageSize();
   ssize_t sz = page->filled_page.size;
-  IF_DEBUG(sanity, memset(page, 0xaa, sz));
 
   // Break the page, which may be a large multi-page allocation, into
   // individual pages for the page pool
   while (sz > 0) {
     if (m32_free_page_pool_size < M32_MAX_FREE_PAGE_POOL_SIZE) {
       mprotectForLinker(page, pgsz, MEM_READ_WRITE);
+      IF_DEBUG(sanity, memset(page, 0xaa, pgsz));
       SET_PAGE_TYPE(page, FREE_PAGE);
       page->free_page.next = m32_free_page_pool;
       m32_free_page_pool = page;



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/14b2e3d3dda104c62c5abafd3353dd0315de71ad

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/14b2e3d3dda104c62c5abafd3353dd0315de71ad
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20221222/aab2567d/attachment.html>


More information about the ghc-commits mailing list