<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 11 June 2017 at 22:44, Joachim Breitner <span dir="ltr"><<a href="mailto:mail@joachim-breitner.de" target="_blank">mail@joachim-breitner.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<span class="gmail-"><br>
Am Sonntag, den 11.06.2017, 10:44 -0400 schrieb Ben Gamari:<br>
> This is certainly one consideration. Another is that you would also<br>
> need to teach the garbage collector to understand closures with sub-<br>
> word-size fields. Currently we can encode whether each field of a<br>
> closure is a pointer or not with a simple bitmap. If we naively<br>
> allowed smaller fields we would need to increase the granularity of<br>
> this representation to encode bytes.<br>
><br>
> Of course, one way to work around this would be to impose an<br>
> invariant that guarantees that pointers are always word-aligned. Then<br>
> we would probably want to shuffle sub-word sized fields, allowing two<br>
> Word16s to inhabit a single word.<br>
<br>
</span>that is not an issue; we already sort field into pointers first, and<br>
non-pointers later. So all pointers are at the beginning and nicely<br>
aligned, and all the non-pointer data can follow in whatever weird<br>
format. The GC only needs to know how many words in total are used by<br>
the non-pointer data.<br></blockquote><div><br></div><div>But the compiler has no support for sub-word-sized fields yet.  I made a partial patch to support it a while ago: <a href="https://phabricator.haskell.org/D38">https://phabricator.haskell.org/D38</a> </div><div><br></div><div>Cheers</div><div>Simon </div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Greetings,<br>
Joachim<br>
<span class="gmail-HOEnZb"><font color="#888888">--<br>
Joachim “nomeata” Breitner<br>
  <a href="mailto:mail@joachim-breitner.de">mail@joachim-breitner.de</a> • <a href="https://www.joachim-breitner.de/" rel="noreferrer" target="_blank">https://www.joachim-breitner.<wbr>de/</a><br>
  XMPP: <a href="mailto:nomeata@joachim-breitner.de">nomeata@joachim-breitner.de</a> • OpenPGP-Key: 0xF0FBF51F<br>
  Debian Developer: <a href="mailto:nomeata@debian.org">nomeata@debian.org</a></font></span><br>______________________________<wbr>_________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/ghc-devs</a><br>
<br></blockquote></div><br></div></div>