Phobos addition formal review: std.experimental.allocator
Brian Schott via Digitalmars-d
digitalmars-d at puremagic.com
Sun Jun 14 15:47:57 PDT 2015
On Sunday, 14 June 2015 at 14:30:00 UTC, Andrei Alexandrescu
wrote:
> Interesting. Do you have a repro for this? Thanks! -- Andrei
Not yet, but while looking for one I found that this code
triggers an assertion in Region.expand()
```
module test;
import std.experimental.allocator;
import std.stdio;
private alias AllocatorType = CAllocatorImpl!(AllocatorList!(
n => Region!Mallocator(1024 * 4), NullAllocator));
struct Big {
ubyte[1024] bytes;
}
void main(string[] args){
auto a = new AllocatorType;
foreach (i; 0 .. 100) {
a.make!Big();
writeln(i);
}
}
```
More information about the Digitalmars-d
mailing list