Thread overview
[Issue 16252] Region allocator should not be copyable
Jul 08, 2016
Lodovico Giaretta
Sep 03, 2017
Igor
Dec 17, 2022
Iain Buclaw
Dec 17, 2022
Richard Cattermole
July 08, 2016
https://issues.dlang.org/show_bug.cgi?id=16252

Lodovico Giaretta <lodovico@giaretart.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lodovico@giaretart.net

--
September 03, 2017
https://issues.dlang.org/show_bug.cgi?id=16252

Igor <stojkovic.igor@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stojkovic.igor@gmail.com

--- Comment #1 from Igor <stojkovic.igor@gmail.com> ---
Would it work if we allow copying in this case but reserve first few bytes from allocated memory to count references to it so we can only free it when count says there are no more references to it. I think we would just need to increment count on postBlit and decrement it in destructor and opAssign. Something like what I did here in my implementation of SharedRegion:

https://github.com/igor84/dngin/blob/master/source/util/allocators.d#L176

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=16252

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=16252

Richard Cattermole <alphaglosined@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alphaglosined@gmail.com

--- Comment #2 from Richard Cattermole <alphaglosined@gmail.com> ---
Alternatively, it should support moving rather than copying.

This allows other allocator data structures like free lists to move it into their own memory (which is quite a useful trick).

--