[Git][ghc/ghc][wip/js-fileStat] Add comment explaining the use of Emscripten's `stat` layout.

Josh Meredith (@JoshMeredith) gitlab at gitlab.haskell.org
Thu Jan 19 11:11:32 UTC 2023



Josh Meredith pushed to branch wip/js-fileStat at Glasgow Haskell Compiler / GHC


Commits:
6af8bfb5 by Josh Meredith at 2023-01-19T11:11:18+00:00
Add comment explaining the use of Emscripten's `stat` layout.

- - - - -


1 changed file:

- libraries/base/jsbits/base.js


Changes:

=====================================
libraries/base/jsbits/base.js
=====================================
@@ -452,6 +452,10 @@ function h$base_c_s_isfifo(mode) {
 }
 
 #ifndef GHCJS_BROWSER
+// The `fileStat` is filled according to the layout of Emscripten's `stat`
+// struct - defined in stat.h. We must use this layout due to this header
+// file being used for retrieve the offsets for hsc files that peek into
+// memory locations of structs directly.
 function h$base_fillStat(fs, b, off) {
     if(off%4) throw "h$base_fillStat: not aligned";
     var o = off>>2;



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6af8bfb5f74751b5692c50ee9263841c79c3bea9

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6af8bfb5f74751b5692c50ee9263841c79c3bea9
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/20230119/67dfae57/attachment.html>


More information about the ghc-commits mailing list