Inlining Ref Functions

dsimcha dsimcha at yahoo.com
Sun May 17 11:22:21 PDT 2009


== Quote from Denis Koroskin (2korden at gmail.com)'s article
> On Sat, 16 May 2009 00:36:16 +0400, dsimcha <dsimcha at yahoo.com> wrote:
> > The fact that DMD does not inline functions with ref parameters has come
> > up
> > several times deep in threads on this NG before, but it's never really
> > received proper attention.  After changing a few swaps in
> > performance-critical
> > areas of my code to "manually inlined" swaps and seeing significant
> > speedups,
> > I'm kind of curious what the rationale is for not inlining functions w/
> > ref
> > params.  Is there a good technical reason for this or is it simply a
> > matter of
> > having higher priorities?  Is inlining functions w/ ref params on the
> > "to do
> > eventually" list?
> How about bugzillizing the feature request?

It's already in there as bug 2008, though I updated it recently to show a
disassembly proving that DMD can inline pointer param functions but not ref param
functions. My guess is that, to someone already generally familiar w/ the DMD code
base (I'm not), this would be really easy to fix, because ref params are just
syntactic sugar for pointers.  Heck, IIRC you can use ref params as pointers in
asm blocks.



More information about the Digitalmars-d mailing list