Re: Class instance memory overhead lower than 3 words?

2018-01-24 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, January 24, 2018 17:50:35 Ali Çehreli via Digitalmars-d-learn wrote: > On 01/24/2018 05:43 PM, Jonathan M Davis wrote: > > On Thursday, January 25, 2018 00:10:32 Nicholas Wilson via > > Digitalmars-d- > > > > learn wrote: > >> One pointer for the vtbl, one for the monitor, not sure

Re: Class instance memory overhead lower than 3 words?

2018-01-24 Thread Ali Çehreli via Digitalmars-d-learn
On 01/24/2018 05:43 PM, Jonathan M Davis wrote: On Thursday, January 25, 2018 00:10:32 Nicholas Wilson via Digitalmars-d- learn wrote: One pointer for the vtbl, one for the monitor, not sure what the other one is. The TypeInfo maybe? I'm not sure where that lives. - Jonathan M Davis

Re: Class instance memory overhead lower than 3 words?

2018-01-24 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, January 25, 2018 00:10:32 Nicholas Wilson via Digitalmars-d- learn wrote: > One pointer for the vtbl, one for the monitor, not sure what the > other one is. The TypeInfo maybe? I'm not sure where that lives. - Jonathan M Davis

Re: Class instance memory overhead lower than 3 words?

2018-01-24 Thread Nicholas Wilson via Digitalmars-d-learn
On Wednesday, 24 January 2018 at 22:27:40 UTC, Nordlöw wrote: On Wednesday, 24 January 2018 at 21:47:26 UTC, H. S. Teoh wrote: On Wed, Jan 24, 2018 at 09:48:21PM +, Nordlöw via Digitalmars-d-learn wrote: Why is the memory overhead for a class instance as high as 3 words (24 bytes on 64-bit

Re: Class instance memory overhead lower than 3 words?

2018-01-24 Thread Nicholas Wilson via Digitalmars-d-learn
On Wednesday, 24 January 2018 at 21:48:21 UTC, Nordlöw wrote: Why is the memory overhead for a class instance as high as 3 words (24 bytes on 64-bit systems? I find that annoyingly much for my knowledge database application. I'm aware of extern(C++), having one word overhead, but such

Re: Class instance memory overhead lower than 3 words?

2018-01-24 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 24 January 2018 at 21:47:26 UTC, H. S. Teoh wrote: On Wed, Jan 24, 2018 at 09:48:21PM +, Nordlöw via Digitalmars-d-learn wrote: Why is the memory overhead for a class instance as high as 3 words (24 bytes on 64-bit systems? I find that annoyingly much for my knowledge

Re: Class instance memory overhead lower than 3 words?

2018-01-24 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jan 24, 2018 at 09:48:21PM +, Nordlöw via Digitalmars-d-learn wrote: > Why is the memory overhead for a class instance as high as 3 words (24 > bytes on 64-bit systems? I find that annoyingly much for my knowledge > database application. [...] There's been an attempt to get rid of the

Class instance memory overhead lower than 3 words?

2018-01-24 Thread Nordlöw via Digitalmars-d-learn
Why is the memory overhead for a class instance as high as 3 words (24 bytes on 64-bit systems? I find that annoyingly much for my knowledge database application. I'm aware of extern(C++), having one word overhead, but such extern(C++)-classes cannot use all of D; I get compilation errors such

Re: [dlang library documentation] Why there are dlang.org/library and dlang.org/phobos?

2018-01-24 Thread John Gabriele via Digitalmars-d-learn
On Tuesday, 23 January 2018 at 19:05:21 UTC, Seb wrote: On Monday, 22 January 2018 at 19:38:45 UTC, John Gabriele wrote: On Monday, 22 January 2018 at 15:32:29 UTC, Adam D. Ruppe wrote: On Monday, 22 January 2018 at 15:18:38 UTC, Johann wrote: Maybe it's due to historical reasons. It's

Re: getting member functions of a struct and Error: identifier expected following ., not this

2018-01-24 Thread aliak via Digitalmars-d-learn
On Wednesday, 24 January 2018 at 07:55:01 UTC, thedeemon wrote: On Tuesday, 23 January 2018 at 00:00:38 UTC, aliak wrote: [...] The struct defined inside a scope can mention variables defined in that scope (e.g. use them in its methods), so it needs a pointer to the place where those closed

Re: `Alias this` to a mixed in property

2018-01-24 Thread Bastiaan Veelo via Digitalmars-d-learn
On Wednesday, 24 January 2018 at 14:21:42 UTC, ag0aep6g wrote: The spec says that you cannot make an overload set just by mixing in multiple functions/methods with the same name. Instead, you have to do it like this: mixin getter g; mixin setter!int s; alias p = g.p; alias p = s.p;

Re: `Alias this` to a mixed in property

2018-01-24 Thread ag0aep6g via Digitalmars-d-learn
On 01/24/2018 02:24 PM, Bastiaan Veelo wrote: `Alias this` to mixed in properties does not seem to work, see below. If you think it should, I'll file an issue. Otherwise: can this be made to work somehow? Not supposed to work as it is. The spec says that you cannot make an overload set just

`Alias this` to a mixed in property

2018-01-24 Thread Bastiaan Veelo via Digitalmars-d-learn
Hi, `Alias this` to mixed in properties does not seem to work, see below. If you think it should, I'll file an issue. Otherwise: can this be made to work somehow? Interestingly, if you uncomment either the mixin getter or setter (row 36 or 37) and its corresponding use in `main`, then the