Final by default?

Jacob Carlborg doob at me.com
Sun Mar 16 02:20:10 PDT 2014


On 2014-03-16 00:11, Marco Leise wrote:

> What about the way Microsoft went with the Win32 API?
> - struct fields are exposed
> - layouts may change only by appending fields to them
> - they are always passed by pointer
> - the actual size is stored in the first data field
>
> I think this is worth a look. Since all these function calls
> don't come for free. (Imagine a photo management software
> that has to check various properties of 20_000 images.)

The modern runtime for Objective-C has a non-fragile ABI for its 
classes. Instead of accessing a field with an compile time known offset 
an offset calculated at runtime/load time is used when accessing a 
field. This allows to freely reorganize fields without breaking subclasses.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list