Re: How do I create classes dynamically?

2021-04-14 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 14 April 2021 at 20:38:16 UTC, Mario wrote: Maybe I am just too short in D, but I wanted to find out if it is possible to create classes dynamically. My problem is, I just don't know where to start reading. Maybe at mixin templates? What exactly do you mean? Your goal is probab

Re: How do I create classes dynamically?

2021-04-14 Thread Mario via Digitalmars-d-learn
On Wednesday, 14 April 2021 at 20:47:57 UTC, Steven Schveighoffer wrote: There is no good supported way to do this with the current runtime. The way this is normally done is to use your own reflection system, and build a mechanism to create classes based on their name. There was an old way,

Re: How do I create classes dynamically?

2021-04-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/14/21 4:38 PM, Mario wrote: Maybe I am just too short in D, but I wanted to find out if it is possible to create classes dynamically. My problem is, I just don't know where to start reading. Maybe at mixin templates? CreateClassWithName!("MyDynamicClassName"); should create the following

How do I create classes dynamically?

2021-04-14 Thread Mario via Digitalmars-d-learn
Maybe I am just too short in D, but I wanted to find out if it is possible to create classes dynamically. My problem is, I just don't know where to start reading. Maybe at mixin templates? CreateClassWithName!("MyDynamicClassName"); should create the following class to work with dynamically:

Re: GC memory fragmentation

2021-04-14 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 14 April 2021 at 12:47:22 UTC, Heromyth wrote: On Sunday, 11 April 2021 at 09:10:22 UTC, tchaloupka wrote: Hi, we're using vibe-d (on Linux) for a long running REST API server and have problem with constantly growing memory until system kills it with OOM killer. The Hunt Fram

Re: What are virtual functions?

2021-04-14 Thread FeepingCreature via Digitalmars-d-learn
On Wednesday, 14 April 2021 at 13:43:20 UTC, Berni44 wrote: I'm trying to understand, what virtual functions are. I found the [specs](https://dlang.org/spec/function.html#virtual-functions), but I can't make head or tail of it. - What is a `vtbl[]`? Obviously a function pointer table. But whe

Re: What are virtual functions?

2021-04-14 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 14 April 2021 at 13:43:20 UTC, Berni44 wrote: I'm asking, because I'm currently writing new docs for `std.format`. The [current (stable) docs of `formatValue`](https://dlang.org/phobos/std_format.html#formatValue) tell, that some `toString` versions are discouraged, but not for vir

What are virtual functions?

2021-04-14 Thread Berni44 via Digitalmars-d-learn
I'm trying to understand, what virtual functions are. I found the [specs](https://dlang.org/spec/function.html#virtual-functions), but I can't make head or tail of it. - What is a `vtbl[]`? Obviously a function pointer table. But where to find this? The examples don't use it. Maybe something

Re: GC memory fragmentation

2021-04-14 Thread Heromyth via Digitalmars-d-learn
On Sunday, 11 April 2021 at 09:10:22 UTC, tchaloupka wrote: Hi, we're using vibe-d (on Linux) for a long running REST API server and have problem with constantly growing memory until system kills it with OOM killer. The Hunt Framework is also suffering from this. We are trying to make a si

Re: GC memory fragmentation

2021-04-14 Thread tchaloupka via Digitalmars-d-learn
On Tuesday, 13 April 2021 at 12:30:13 UTC, tchaloupka wrote: I'm not so sure if pages of small objects (or large) that are not completely empty can be reused as a new bucket or only free pages can be reused. Does anyone has some insight of this? Some kind of GC memory dump and analyzer tool a