[Issue 14758] TypeInfo causes excessive binary bloat
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Aug 19 23:34:48 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14758
Dmitry Olshansky <dmitry.olsh at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dmitry.olsh at gmail.com
--- Comment #1 from Dmitry Olshansky <dmitry.olsh at gmail.com> ---
> I have modeled these statically with D's fantastic modelling features to produce an object-oriented, easily-navigable hierarchy of the hardware memory map (example: https://github.com/JinShil/stm32f42_discovery_demo/blob/master/source/stm32f42/gpio.d). It is an excellent model that generates fast code and plays very well with tooling. The only problem is the TypeInfo bloat.
I'd just go for structs + template mixins for inheritance. It's not like you do
any of virtual calls/typeinfo/object factory/whatever.
mixin template Register(blah...){ }
struct Peripheral{
mixin Register!(x,y,z,...);
mixin Register!(q,w,e,...);
}
Makes any sesne?
--
More information about the Digitalmars-d-bugs
mailing list