[Issue 16252] Region allocator should not be copyable

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Sep 3 14:12:54 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=16252

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

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

--- Comment #1 from Igor <stojkovic.igor at 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

--


More information about the Digitalmars-d-bugs mailing list