November 07, 2013 Re: std.allocator ready for some abuse | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Thursday, 7 November 2013 at 16:28:42 UTC, Andrei Alexandrescu wrote:
> On 11/7/13 5:30 AM, Namespace wrote:
>> Nice! But I suggest two things:
>> 1. Add a reset function for reusing the same storage
>
> freeAll().
There is no freeAll. Did you mean deallocateAll?
----
void deallocateAll()
{
_crt = null;
}
----
_crt is null and the same storage can't be used again.
|
November 07, 2013 Re: std.allocator ready for some abuse | ||||
---|---|---|---|---|
| ||||
Posted in reply to Namespace | On 11/7/13 9:02 AM, Namespace wrote:
> On Thursday, 7 November 2013 at 16:28:42 UTC, Andrei Alexandrescu wrote:
>> On 11/7/13 5:30 AM, Namespace wrote:
>>> Nice! But I suggest two things:
>>> 1. Add a reset function for reusing the same storage
>>
>> freeAll().
>
> There is no freeAll. Did you mean deallocateAll?
> ----
> void deallocateAll()
> {
> _crt = null;
> }
> ----
> _crt is null and the same storage can't be used again.
Sorry that's indeed the name and there's a bug in it!
Andrei
|
November 07, 2013 Re: std.allocator ready for some abuse | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Thursday, 24 October 2013 at 21:17:45 UTC, Andrei Alexandrescu wrote:
> On 10/24/13 2:08 PM, Walter Bright wrote:
>> On 10/24/2013 12:54 PM, Andrei Alexandrescu wrote:
>>> I know it's been a long wait. Hopefully it was worth it. The alpha
>>> release of
>>> untyped allocators is ready for tire-kicking and a test drive.
>>>
>>> Code: https://github.com/andralex/phobos/blob/allocator/std/allocator.d
>>>
>>> Dox: http://erdani.com/d/phobos-prerelease/std_allocator.html
>>
>> I'm impressed. I looked for 3 or 4 must haves, and they were there! It
>> covers all the cases I've written custom allocators for.
>
> <big sigh of relief>
>
>
> Andrei
So, is the idea to add an optional allocator template parameter to various objects in the phobos library, or is this only intended to be used standalone via the with statement?
-Chris
|
November 09, 2013 Re: std.allocator ready for some abuse | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 11/01/2013 10:00 PM, Andrei Alexandrescu wrote: > On 10/30/13 1:02 PM, Martin Nowak wrote: >> This looks really promising. >> There are a lot of building blocks and the way different capabilities >> are modelled by optional methods nicely solves the biggest difficulty >> with allocators. >> I think it's important to put this in it's own github repo and add a dub >> package for it on code.dlang.org so that it's easy to test the >> implementation and to contribute improvements. > > Tried to register github package andralex/phobos, and: > I transferred you a separate repo with all std.allocator commits. https://github.com/dawgfoto/std_allocator You can build the library with "dub" and run unittests with "dub -build=unittest -config=unittest". Creating docs is a problem, maybe some expert can chime in. > > This is obviously because package.json is absent from the repo, but I'd > say it shouldn't cause such an error. https://github.com/rejectedsoftware/dub-registry/issues/31 > https://github.com/andralex/phobos/blob/allocator/std/allocator.d#L3723 > > The newly-added allocator should come to the front of the list. > > My suspicion, however, is that you won't be able to measure a > difference. A well-dimensioned cascade of regions will have a high > ration of allocations within a regions to number of regions. > You're probably right. |
November 13, 2013 Re: std.allocator ready for some abuse | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | > Tried to register github package andralex/phobos, and: > > ============================ > 500 - Internal Server Error > > Internal Server Error Now fixed https://github.com/rejectedsoftware/dub-registry/issues/31. |
November 16, 2013 Re: std.allocator ready for some abuse | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | Passing -g flag to the linker causes a linker error on win32. Very simple program: import std.allocator; void main() {} Compilation commands: dmd.exe -g -debug -c std/allocator.d -ofallocator.obj dmd.exe -g -debug -c main.d -ofmain.obj dmd.exe out.exe -g allocator.obj main.obj Output: dmd.exe out.exe -g allocator.obj main.obj OPTLINK (R) for Win32 Release 8.00.13 Copyright (C) Digital Mars 1989-2010 All rights reserved. http://www.digitalmars.com/ctg/optlink.html allocator.obj(allocator) Error 42: Symbol Undefined __aligned_malloc allocator.obj(allocator) Error 42: Symbol Undefined __aligned_free allocator.obj(allocator) Error 42: Symbol Undefined __aligned_realloc --- errorlevel 3 Without -g flag on the last command (dmd.exe out.exe allocator.obj main.obj) no linker error appears. |
November 16, 2013 Re: std.allocator ready for some abuse | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jack Applegame | On 11/16/13 2:50 AM, Jack Applegame wrote: > Passing -g flag to the linker causes a linker error on win32. [snip] Maybe this would help? http://community.rti.com/kb/why-does-visual-studio-complain-about-alignedmalloc-and-alignedfree Andrei |
February 17, 2014 Re: std.allocator ready for some abuse | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | Andrei, what is current state of std.allocator? I am asking this in context of recent Walter Phobos proposal (ScopeBuffer) to evaluate how feasible is to define any relations between two at current stage. |
February 17, 2014 Re: std.allocator ready for some abuse | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On 2/17/14, 5:55 AM, Dicebot wrote:
> Andrei, what is current state of std.allocator? I am asking this in
> context of recent Walter Phobos proposal (ScopeBuffer) to evaluate how
> feasible is to define any relations between two at current stage.
Progress on std.allocator is slow but I do have a plan. I don't think we should pull ScopeBuffer yet.
Andrei
|
February 11, 2015 Re: std.allocator ready for some abuse | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Monday, 17 February 2014 at 15:49:27 UTC, Andrei Alexandrescu wrote:
> On 2/17/14, 5:55 AM, Dicebot wrote:
>> Andrei, what is current state of std.allocator? I am asking this in
>> context of recent Walter Phobos proposal (ScopeBuffer) to evaluate how
>> feasible is to define any relations between two at current stage.
>
> Progress on std.allocator is slow but I do have a plan. I don't think we should pull ScopeBuffer yet.
>
> Andrei
Mr. Alexandrescu. What about std allocator? Is feature valuable? I've took a look in Wish List in wiki and Allocator still there.
If this feature is valuable. What is left in currently implementation of your project? Can you tell about state, maybe show To Do list?
Sorry, if my english is not clear. Thank you.
|
Copyright © 1999-2021 by the D Language Foundation