digitalmars.D.learn - out of memory error with template mixins
- Saaa (5/5) Dec 02 2009 I was trying out composite oriented programming, meaning moving class
- Saaa (12/12) Dec 03 2009 Removing a struct definition from the second mixin seems to fix the prob...
- bearophile (4/5) Dec 03 2009 It's generally better if you show a tiny compilable example that has the...
I was trying out composite oriented programming, meaning moving class functionality into templates which you then mixin. First part mixined just fine, second also ok, third . . - Error : Out of memory (2GB VM) Even with an empty template :(
Dec 02 2009
Removing a struct definition from the second mixin seems to fix the problem. Is this a (known) bug? The struct was only used within that template. public struct S { enum LOCAL { ONE, TWO }; LOCAL local; bool b = false; StructOut s; ENUM_OUT eo; }
Dec 03 2009
Saaa:Is this a (known) bug?It's generally better if you show a tiny compilable example that has the problem. Bye, bearophile
Dec 03 2009
bearophile wrote:Saaa:I'm trying :) I just hoped somebody would recognize it from my babblingIs this a (known) bug?It's generally better if you show a tiny compilable example that has the problem. Bye, bearophile
Dec 03 2009
Tomorrow I'll continue my quest for the mall piece of code which will choke the compiler.
Dec 03 2009
Can't recreate the error in a small test project (5 modules). I think the problem lies somewhere in between cyclic module imports, mixin struct definitions and maybe the actual size of the class(1k) and its complexity of interfaces(8). One more thing: The out of memory is before it can tell there is an variable missing, although the error is also there when the variable is not missing.
Dec 03 2009
module project.foo.templates.bar; template Bar() { //struct is not used anywhere public struct Eye{} //comment this line out and the error is gone. }
Dec 03 2009