On 5/15/15 1:28 PM, Timon Gehr wrote:
I have just noticed that all the calls to alignedAllocate do not pass
the alignment argument.
Crikey, that must have something to do with all that missing test
coverage :o). -- Andrei
On 5/12/15 12:57 PM, Timon Gehr wrote:
On 05/12/2015 04:54 AM, Andrei Alexandrescu wrote:
On 5/11/15 4:59 PM, Timon Gehr wrote:
On 05/11/2015 08:48 PM, Andrei Alexandrescu wrote:
On 5/11/15 11:31 AM, Timon Gehr wrote:
- The assertion in line 141 may fail. (expand can return false.)
OK, it
On 05/15/2015 06:58 PM, Andrei Alexandrescu wrote:
On 5/12/15 12:57 PM, Timon Gehr wrote:
...
Missed alignedReallocate. :o)
On a related note, alignedReallocate is now also buggy in that it does
not necessarily align the allocated memory if b.ptr is null.
Missed this, thanks for the email!
On 05/12/2015 04:54 AM, Andrei Alexandrescu wrote:
On 5/11/15 4:59 PM, Timon Gehr wrote:
On 05/11/2015 08:48 PM, Andrei Alexandrescu wrote:
On 5/11/15 11:31 AM, Timon Gehr wrote:
- The assertion in line 141 may fail. (expand can return false.)
OK, it seems the previous commit should take
On 5/10/15 5:08 AM, Timon Gehr wrote:
On 05/10/2015 01:48 PM, Timon Gehr wrote:
bool expand(ref void[] b, size_t delta);
Post: !result || b.length == old(b).length + delta Expands b by
delta bytes. If delta == 0, succeeds without changing b. If b is null,
the call evaluates b =
On 05/11/2015 05:28 PM, Andrei Alexandrescu wrote:
On 5/10/15 5:08 AM, Timon Gehr wrote:
On 05/10/2015 01:48 PM, Timon Gehr wrote:
bool expand(ref void[] b, size_t delta);
Post: !result || b.length == old(b).length + delta Expands b by
delta bytes. If delta == 0, succeeds without
On 5/11/15 11:06 AM, Timon Gehr wrote:
- If the rounding function is not piecewise constant with one fixed
point per piece, it can happen that 'allocated = needed' but 'allocated
goodAllocSize(needed)'. Then, the allocated size will be inconsistent
with goodAllocSize. (This is why I recommended
On 05/11/2015 08:06 PM, Timon Gehr wrote:
On 05/11/2015 05:28 PM, Andrei Alexandrescu wrote:
On 5/10/15 5:08 AM, Timon Gehr wrote:
On 05/10/2015 01:48 PM, Timon Gehr wrote:
bool expand(ref void[] b, size_t delta);
Post: !result || b.length == old(b).length + delta Expands b by
delta
On 05/11/2015 08:31 PM, Timon Gehr wrote:
- The assertion in line 141 may fail. (expand can return false.)
(Same thing further down, line 167.)
On 5/11/15 11:31 AM, Timon Gehr wrote:
- The assertion in line 141 may fail. (expand can return false.)
OK, it seems the previous commit should take care of that.
(Rant: Go on, conflate assert and assume in -release and then, when a
sufficiently smart optimizer runs, suddenly expand will
On 05/11/2015 08:45 PM, Andrei Alexandrescu wrote:
On 5/11/15 11:06 AM, Timon Gehr wrote:
- If the rounding function is not piecewise constant with one fixed
point per piece, it can happen that 'allocated = needed' but 'allocated
goodAllocSize(needed)'. Then, the allocated size will be
On 05/11/2015 08:48 PM, Andrei Alexandrescu wrote:
On 5/11/15 11:31 AM, Timon Gehr wrote:
- The assertion in line 141 may fail. (expand can return false.)
OK, it seems the previous commit should take care of that.
...
Nope.
Well, yes, in the sense that there is no longer a possibly failing
On 05/12/2015 01:38 AM, Timon Gehr wrote:
- If b.ptr is null, then line 113 is bad in case goodAllocSize(0) 0.
That should be fixed in the same commit; I just handle expansion of null
blocks up front in expand().
...
OK.
(Scrap that.)
On 5/11/15 4:59 PM, Timon Gehr wrote:
On 05/11/2015 08:48 PM, Andrei Alexandrescu wrote:
On 5/11/15 11:31 AM, Timon Gehr wrote:
- The assertion in line 141 may fail. (expand can return false.)
OK, it seems the previous commit should take care of that.
...
Nope.
Well, yes, in the sense
On 05/10/2015 05:29 AM, Andrei Alexandrescu wrote:
On 5/9/15 3:38 PM, Timon Gehr wrote:
Thanks! Looks good, except:
106| if (!parent.expand(b, goodAllocSize(needed) - b.length))
Let's see, this is a tad tricky. needed is the needed size, i.e.
b.length + delta. We want to expand to a final
On 05/10/2015 05:32 AM, Andrei Alexandrescu wrote:
On 5/9/15 3:41 PM, Timon Gehr wrote:
On 05/10/2015 12:38 AM, Timon Gehr wrote:
142| return parent.reallocate(b, gs);
172| return parent.alignedReallocate(b, gs, a);
(Note that those code snippets also occur in their documentation.)
Can't
On 05/10/2015 05:38 AM, Andrei Alexandrescu wrote:
On 5/9/15 3:54 PM, Timon Gehr wrote:
On 05/10/2015 12:38 AM, Timon Gehr wrote:
monotone increasing and piecewise constant with one fixed point per
piece.
(Note that monotone increasing is implied by piecewise constant with one
fixed point
On 05/10/2015 01:48 PM, Timon Gehr wrote:
bool expand(ref void[] b, size_t delta);
Post: !result || b.length == old(b).length + delta Expands b by
delta bytes. If delta == 0, succeeds without changing b. If b is null,
the call evaluates b = allocate(delta) and returns b !is null.
On 5/10/15 12:52 AM, Marco Leise wrote:
* zeroesAllocations
I called it elementsAreInited and as the name suggests, it
tells whether new elements receive their T.init
automatically.
Now std.allocator deals mostly with raw memory, so zeroing
is the only option, but I can see some
Am Thu, 07 May 2015 14:12:40 -0700
schrieb Andrei Alexandrescu seewebsiteforem...@erdani.org:
Helps an allocator without good reallocation capabilities:
http://erdani.com/d/phobos-prerelease/std_experimental_allocator_quantizer.html
Destruction welcome.
Andrei
I haven't tested it,
On 5/10/15 4:48 AM, Timon Gehr wrote:
Yes, but 'expand' expects a _full_ block that was allocated by that
allocator:
Ah, now I understand. Thanks, will fix! -- Andrei
On 5/10/15 5:02 AM, Timon Gehr wrote:
size_t brokenRoundingFunction(size_t siz){
if(siz==10) return 40;
if(siz==20) return 30;
return siz;
}
Say no more, got it. I'll change the docs. -- Andrei
On 5/10/15 5:08 AM, Timon Gehr wrote:
On 05/10/2015 01:48 PM, Timon Gehr wrote:
bool expand(ref void[] b, size_t delta);
Post: !result || b.length == old(b).length + delta Expands b by
delta bytes. If delta == 0, succeeds without changing b. If b is null,
the call evaluates b =
On 05/10/2015 12:38 AM, Timon Gehr wrote:
142| return parent.reallocate(b, gs);
172| return parent.alignedReallocate(b, gs, a);
(Note that those code snippets also occur in their documentation.)
On 5/9/15 3:41 PM, Timon Gehr wrote:
On 05/10/2015 12:38 AM, Timon Gehr wrote:
142| return parent.reallocate(b, gs);
172| return parent.alignedReallocate(b, gs, a);
(Note that those code snippets also occur in their documentation.)
Can't find gs in the doc comments, is it there? -- Andrei
On 05/09/2015 06:09 PM, Andrei Alexandrescu wrote:
On 5/9/15 6:27 AM, Timon Gehr wrote:
On 05/07/2015 11:12 PM, Andrei Alexandrescu wrote:
Helps an allocator without good reallocation capabilities:
http://erdani.com/d/phobos-prerelease/std_experimental_allocator_quantizer.html
Destruction
On 5/9/15 3:54 PM, Timon Gehr wrote:
On 05/10/2015 12:38 AM, Timon Gehr wrote:
monotone increasing and piecewise constant with one fixed point per
piece.
(Note that monotone increasing is implied by piecewise constant with one
fixed point per piece, so it does not necessarily need to be
On 05/10/2015 12:38 AM, Timon Gehr wrote:
monotone increasing and piecewise constant with one fixed point per piece.
(Note that monotone increasing is implied by piecewise constant with one
fixed point per piece, so it does not necessarily need to be documented
separately.)
On 5/9/15 3:38 PM, Timon Gehr wrote:
Thanks! Looks good, except:
106| if (!parent.expand(b, goodAllocSize(needed) - b.length))
Let's see, this is a tad tricky. needed is the needed size, i.e.
b.length + delta. We want to expand to a final size of
goodAllocSize(needed). So we need to pass
On 5/9/15 6:27 AM, Timon Gehr wrote:
On 05/07/2015 11:12 PM, Andrei Alexandrescu wrote:
Helps an allocator without good reallocation capabilities:
http://erdani.com/d/phobos-prerelease/std_experimental_allocator_quantizer.html
Destruction welcome.
Andrei
quantizer.d is not in the
On 05/07/2015 11:12 PM, Andrei Alexandrescu wrote:
Helps an allocator without good reallocation capabilities:
http://erdani.com/d/phobos-prerelease/std_experimental_allocator_quantizer.html
Destruction welcome.
Andrei
quantizer.d is not in the commit:
Helps an allocator without good reallocation capabilities:
http://erdani.com/d/phobos-prerelease/std_experimental_allocator_quantizer.html
Destruction welcome.
Andrei
32 matches
Mail list logo