[Issue 3150] cast from dynamic array to ulong is allowed

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 10 04:08:34 PDT 2010


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


Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy at yahoo.com


--- Comment #3 from Steven Schveighoffer <schveiguy at yahoo.com> 2010-05-10 04:08:33 PDT ---
Actually, you need a type besides a D array because you do not want to trigger
runtime calls when setting the length.

Because those functions are extern(C) functions, you can return whatever type
you want (as long as it's the same size as an array struct).  But the portion
which sets the length must not use an actual array.

What we can do is change the return types (there are other functions which
return ulong) from ulong to the Array struct defined somewhere in that file.

There might be opitmizations that the compiler makes when forming a ulong vs.
some arbitrary type, I'll have to investigate that.

-- 
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