[Issue 4172] Improve varargs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 30 01:10:42 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4172



--- Comment #12 from nfxjfg at gmail.com 2010-11-30 01:09:11 PST ---
(In reply to comment #9)
> We can revisit this and look into making it more efficient later, but for now I
> just want to get it working.

It's about ease of use, not efficiency. The C ABI is indeed "disastrously
complex". Just look at the code here:

http://www.dsource.org/projects/druntime/browser/trunk/src/core/stdc/stdarg.d

The user has to duplicate that code, if he wants to use TypeInfos to unpack the
arguments, instead of using compile time types (that va_start) would require.
Now think how that would look like on 64 bits.

If you're going to use the 64 C ABI for D variadics, you may as well completely
remove them from D1 and D2.

I don't understand what's so hard about just creating a void*[] on the stack,
whose items points to local variables containing the actual argument data. I've
done something similar before, when I changed the associative array ABI for by
precise GC scanning patch.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list