RE: [commit: ghc] master: include FastString.string_table in CoreMonad.reinitializeGlobals (163de25)

Do you put the FS table back after running the plugin? If not, the same unique may be allocated more than once.
S
| -----Original Message-----
| From: ghc-commits-bounces@haskell.org [mailto:ghc-commits-
| bounces@haskell.org] On Behalf Of Nicolas Frisby
| Sent: 04 July 2013 05:13
| To: ghc-commits@haskell.org
| Subject: [commit: ghc] master: include FastString.string_table in
| CoreMonad.reinitializeGlobals (163de25)
|
| Repository : http://darcs.haskell.org/ghc.git/
|
| On branch : master
|
| https://github.com/ghc/ghc/commit/163de25813d12764aa5ded1666af7c06fee0d6
| 7e
|
| >---------------------------------------------------------------
|
| commit 163de25813d12764aa5ded1666af7c06fee0d67e
| Author: Nicolas Frisby

On Thu, Jul 4, 2013 at 2:52 AM, Simon Peyton-Jones
Do you put the FS table back after running the plugin? If not, the same unique may be allocated more than once.
S
No, I did not do that. And writing this email, I realized my initial reasoning was flawed. There are some decisions to be made. I've written it up here. Feel free to skip Option 1; I think it has the least merit. http://hackage.haskell.org/trac/ghc/wiki/Plugins/ReinitializeGlobals I'd appreciate if people could weigh in.

I'm validating Option 2 at the moment. It works if the plugins force the
FastStrings before returning to the host compiler. However, robustness
would require that each of the plugin's passes also call
reinitializeGlobals, since some FastStrings may have been allocated between
the installation of the plugin and its passes.
On Thu, Jul 4, 2013 at 12:26 PM, Nicolas Frisby
On Thu, Jul 4, 2013 at 2:52 AM, Simon Peyton-Jones
wrote: Do you put the FS table back after running the plugin? If not, the same unique may be allocated more than once.
S
No, I did not do that. And writing this email, I realized my initial reasoning was flawed. There are some decisions to be made.
I've written it up here. Feel free to skip Option 1; I think it has the least merit.
http://hackage.haskell.org/trac/ghc/wiki/Plugins/ReinitializeGlobals
I'd appreciate if people could weigh in.

I pushed Solution 1 as commit 193e0ee9aa8705dcc0020eaaf6bfb6714db6f9ca
today.
The various alternatives are compared/contrasted here, if this ever needs
to be revisited.
http://hackage.haskell.org/trac/ghc/wiki/Plugins/ReinitializeGlobals
(Though perhaps the page name isn't quite on-the-nose anymore.)
On Thu, Jul 4, 2013 at 7:54 PM, Nicolas Frisby
I'm validating Option 2 at the moment. It works if the plugins force the FastStrings before returning to the host compiler. However, robustness would require that each of the plugin's passes also call reinitializeGlobals, since some FastStrings may have been allocated between the installation of the plugin and its passes.
On Thu, Jul 4, 2013 at 12:26 PM, Nicolas Frisby
wrote: On Thu, Jul 4, 2013 at 2:52 AM, Simon Peyton-Jones
wrote:
Do you put the FS table back after running the plugin? If not, the same unique may be allocated more than once.
S
No, I did not do that. And writing this email, I realized my initial reasoning was flawed. There are some decisions to be made.
I've written it up here. Feel free to skip Option 1; I think it has the least merit.
http://hackage.haskell.org/trac/ghc/wiki/Plugins/ReinitializeGlobals
I'd appreciate if people could weigh in.
participants (2)
-
Nicolas Frisby
-
Simon Peyton-Jones