How do you stop functions being inlined?
Simon Marlow
simonmar@microsoft.com
Thu, 2 Aug 2001 10:49:26 +0100
In fact, GHC understands both NOINLINE and NOTINLINE with any
capitalisation. We just tend to use NOINLINE because I think GHC had it
before notInline was mentioned in the report.
Cheers,
Simon
> -----Original Message-----
> From: Julian Seward (Intl Vendor) [mailto:v-julsew@microsoft.com]=20
> Sent: Thursday, August 02, 2001 10:31 AM
> To: George Russell; haskell@haskell.org
> Subject: RE: How do you stop functions being inlined?
>=20
>=20
>=20
> {-# NOINLINE name #-}
>=20
> | -----Original Message-----
> | From: George Russell [mailto:ger@tzi.de]=20
> | Sent: Wednesday, August 01, 2001 3:46 PM
> | To: haskell@haskell.org
> | Subject: How do you stop functions being inlined?
> |=20
> |=20
> | Well, I think we all know the answer to this one, namely=20
> | {-# NOINLINE [name] #-}
> | This is, after all, what GHC does, and what several of the=20
> | files in ghc/fptools do.
> |=20
> | Only slight problem is that according to the Haskell 98
> | report, including Simon Peyton Jones' revised draft, you
> | should use:
> | {-# notInline [name] #-}
> | Most of the time in fptools/hslibs (which I have from
> | GHC), NOINLINE is used, but in one case notInline is used.
> |=20
> | Of course one of the delights of pragmas is that the
> | "pragma should be ignored if an implementation is not prepared to=20
> | handle it.". So if you guess wrong, you may never know,=20
> | until you get a mysterious bug from GHC inlining a call to=20
> | create a global variable via unsafePerformIO. Aren't pragmas=20
> | wonderful?
> |=20
> | Would someone tell me which we are supposed to use? Or=20
> | should I use both "NOINLINE" and "notInline", just to be on=20
> | the safe side?
> |=20
> | _______________________________________________
> | Haskell mailing list
> | Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
> |=20
>=20
> _______________________________________________
> Haskell mailing list
> Haskell@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
>=20