Re: New D technique - disable usage of "new" and "delete"

2018-01-07 Thread jmh530 via Digitalmars-d
On Friday, 5 January 2018 at 20:51:14 UTC, Basile B. wrote: Yeah, i didn't explain correctly the mixin thing. The mixin would be used to disable "new" and "delete", e.g enum disableNewAndDelete = "@disable new (size_t size){return null;} @disable delete (void* p){}"; and then you mix it

Re: New D technique - disable usage of "new" and "delete"

2018-01-05 Thread Basile B. via Digitalmars-d
On Friday, 5 January 2018 at 20:45:20 UTC, jmh530 wrote: On Friday, 5 January 2018 at 19:44:38 UTC, Basile B. wrote: [snip] - Libraries that don't want their aggregates to reside on the GC heap can use this, with a mixin. (note: although the GCAllocator can still be used...) Cool. Not sure

Re: New D technique - disable usage of "new" and "delete"

2018-01-05 Thread jmh530 via Digitalmars-d
On Friday, 5 January 2018 at 19:44:38 UTC, Basile B. wrote: [snip] - Libraries that don't want their aggregates to reside on the GC heap can use this, with a mixin. (note: although the GCAllocator can still be used...) Cool. Not sure I'm following with your point with the mixin. A mixin

New D technique - disable usage of "new" and "delete"

2018-01-05 Thread Basile B. via Digitalmars-d
I was chatting on IRC. One of the topic was about a "@nogc" thread. I suggested something like "core.thread.NoGcThread" that would take a "@nogc" function but then i realized that this hypothetical class could still be allocated on the GC heap. So "new" and "delete" would have to be