Module for manual memory management

Foo via Digitalmars-d digitalmars-d at puremagic.com
Sat Jan 31 01:59:09 PST 2015


On Saturday, 31 January 2015 at 01:07:21 UTC, Andrei Alexandrescu 
wrote:
> On 1/30/15 3:49 PM, Foo wrote:
>> Is there interest in such a thing?
>> I'm currently working on something for my own use and I'm 
>> curious if
>> anyone else would be interested in something like that.
>> I'm aware of Unique, RefCounted, Scoped, emplace and so on, 
>> but I'm not
>> a big fan of some implementations (in my opinion not much of 
>> it follows
>> the KISS principle). Also, as far as I remember, RefCounted 
>> and Unique
>> are somewhat outdated.
>> As said I'm just curious and I'm aware that my code may be 
>> somewhat
>> un-phobos like.
>>
>> My current stand is this: http://dpaste.dzfl.pl/f1423322b7d5
>> Just to make it clear: m3 = manual memory management = mmm = m3
>>
>> and here is some test code: http://dpaste.dzfl.pl/026013fbe19f
>>
>> I repeat: I know that I reimplement some logic like emplace 
>> and that my
>> version is shorter but maybe not quite correct/incomplete.
>
> So why come with your own self-admitted incomplete/incorrect 
> alternatives instead of adding/improving the standard ones? If 
> something's there that shouldn't, remove it. I don't get this 
> "I didn't get it so I'll redo it incompletely".
Too much and too long code. ;)
Sometimes it is better to see a new version from scratch to 
rethink old ones. ;) I'm not for removing them, I'm for 
rebuilding them. And a new version can bring new wind into the 
sails. That's why I'm presented my code here: for discussion.
But that is not that important, my main target was the 
implementation of Unique and Shared. You can adapt them with 
minimal effort. But I'm quite sure that my 'make' function is not 
yet present in phobos.
So, what do you think about discussing if and how my make, Unique 
and Shared could improve phobos.

>> And I'm also aware of std.allocator and so on, but that is 
>> something
>> different IMO.
>
> Agreed.
>
>
> Andrei



More information about the Digitalmars-d mailing list