Struct hidden context pointers
Iain Buclaw
ibuclaw at ubuntu.com
Sun Jul 7 06:30:12 PDT 2013
On 6 July 2013 22:41, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
> On Saturday, July 06, 2013 14:13:29 H. S. Teoh wrote:
>>
>> Shouldn't the frame pointer be generated only if f() actually tries to
>> access something outside of the definition of T?
>
> Probably, but that's arguably an optimization. Regardless, marking it as
> static will force the issue.
>
An optimization that is on similar boundaries as virtual by default. :)
What I see is a non-POD nested struct, one that requires a 'this'
pointer to the outer context to be set-up. However I know that gdc
probably smarter than the front-end implementation about this in that
it (the gcc glue part of the front-end) will acknowledge that there's
no outer context and will set the outer 'this' pointer to null.
Whilst still producing an error if a non-static member tries to access
it's outer context in this situation.
--
Iain Buclaw
*(p < e ? p++ : p) = (c & 0x0f) + '0';
More information about the Digitalmars-d
mailing list