Re: Bulk allocation and partial deallocation for tree data structures.

2017-07-06 Thread Filip Bystricky via Digitalmars-d-learn
On Tuesday, 4 July 2017 at 03:52:39 UTC, Moritz Maxeiner wrote: First of all thank you for your responses! On Tuesday, 4 July 2017 at 02:53:00 UTC, Filip Bystricky wrote: On Tuesday, 4 July 2017 at 01:56:11 UTC, Moritz Maxeiner wrote: [...] However, in many cases it is unacceptable to have

Re: Bulk allocation and partial deallocation for tree data structures.

2017-07-03 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 4 July 2017 at 03:13:14 UTC, Filip Bystricky wrote: Oh and I forgot to mention: another use-case for this would be for arrays. For manually managed arrays like std.container.array, it would make it possible to transfer ownership of individual objects from the array back to the prog

Re: Bulk allocation and partial deallocation for tree data structures.

2017-07-03 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 4 July 2017 at 02:53:00 UTC, Filip Bystricky wrote: On Tuesday, 4 July 2017 at 01:56:11 UTC, Moritz Maxeiner wrote: [...] However, in many cases it is unacceptable to have to prevent the whole block from being freed (especially if the memory is managed by a compacting gc). Then

Re: Bulk allocation and partial deallocation for tree data structures.

2017-07-03 Thread Filip Bystricky via Digitalmars-d-learn
Oh and I forgot to mention: another use-case for this would be for arrays. For manually managed arrays like std.container.array, it would make it possible to transfer ownership of individual objects from the array back to the program after the array goes out of scope. For gc slices, it could en

Re: Bulk allocation and partial deallocation for tree data structures.

2017-07-03 Thread Filip Bystricky via Digitalmars-d-learn
On Tuesday, 4 July 2017 at 01:56:11 UTC, Moritz Maxeiner wrote: On Monday, 3 July 2017 at 17:06:10 UTC, Ali Çehreli wrote: On 07/02/2017 07:56 PM, Stefan Koch wrote: On Monday, 3 July 2017 at 02:51:49 UTC, Filip Bystricky wrote: Anyone? The answer is no. Partial deallocation in an arbitrary

Re: Bulk allocation and partial deallocation for tree data structures.

2017-07-03 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 3 July 2017 at 17:06:10 UTC, Ali Çehreli wrote: On 07/02/2017 07:56 PM, Stefan Koch wrote: On Monday, 3 July 2017 at 02:51:49 UTC, Filip Bystricky wrote: Anyone? The answer is no. Partial deallocation in an arbitrary fashion is not advisable. And there are no standard library mec

Re: Bulk allocation and partial deallocation for tree data structures.

2017-07-03 Thread Ali Çehreli via Digitalmars-d-learn
On 07/02/2017 07:56 PM, Stefan Koch wrote: On Monday, 3 July 2017 at 02:51:49 UTC, Filip Bystricky wrote: Anyone? The answer is no. Partial deallocation in an arbitrary fashion is not advisable. And there are no standard library mechanisms for it. Would it be possible to write a custom std

Re: Bulk allocation and partial deallocation for tree data structures.

2017-07-02 Thread Stefan Koch via Digitalmars-d-learn
On Monday, 3 July 2017 at 02:51:49 UTC, Filip Bystricky wrote: Anyone? The answer is no. Partial deallocation in an arbitrary fashion is not advisable. And there are no standard library mechanisms for it.

Re: Bulk allocation and partial deallocation for tree data structures.

2017-07-02 Thread Filip Bystricky via Digitalmars-d-learn
Anyone?

Bulk allocation and partial deallocation for tree data structures.

2017-06-29 Thread Filip Bystricky via Digitalmars-d-learn
Hello! I'm implementing a persistent hash trie (like in clojure/scala). Every 'persisting' insertion involves allocating a fixed number (6) of nodes (each chunk is a fixed width ranging between 1 and ~33 words). Basically, this data structure always allocates a whole branch at a time, but t