On Monday, 2 April 2018 at 20:43:01 UTC, Alexandru Jercaianu wrote:
I am not completely sure how to solve this, but maybe we can find some clues here [1]. It seems like we should use addRoot on the buffer returned by GC.instance.allocate to keep it alive. Then, we can use addRange on each node after allocation and somehow use 'TypeInfo' to trigger destructors. I'll dig into this more tomorrow and come back with a better answer.

How can there not be a documented answer for this question, given that std.experimental.allocator has been in Phobos for 2 years?

Has std.experimental.allocator only been used for allocating `struct`s?

Is the Region allocator especially misfit for constructing classes?

Thanks, anyway.
  • How to destruct class instanc... Per Nordlöw via Digitalmars-d-learn
    • Re: How to destruct clas... Alexandru Jercaianu via Digitalmars-d-learn
      • Re: How to destruct ... Per Nordlöw via Digitalmars-d-learn
        • Re: How to destr... Steven Schveighoffer via Digitalmars-d-learn
          • Re: How to d... Eduard Staniloiu via Digitalmars-d-learn
            • Re: How... Per Nordlöw via Digitalmars-d-learn
              • Re:... Eduard Staniloiu via Digitalmars-d-learn
                • ... Per Nordlöw via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn
                • ... Per Nordlöw via Digitalmars-d-learn
                • ... Eduard Staniloiu via Digitalmars-d-learn
                • ... rikki cattermole via Digitalmars-d-learn

Reply via email to