www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Region allocator strage error

reply ref2401 <refactor24 gmail.com> writes:
I am getting runtime error: 
core.exception.AssertError std\experimental\allocator\building_b
ocks\region.d(235): Assertion failure

if LEN equals to 3, 5, 7, 9, ...

void main(string[] args) {
	ubyte[1024] memory;
	auto stackAlloc = Region!NullAllocator(memory);
	IAllocator alloc = allocatorObject(&stackAlloc);

	enum LEN = 11;
	float[] arr = alloc.makeArray!float(LEN);
	alloc.expandArray(arr, LEN);
}

OS: win 8.1 Enterprise x64
DMD: 2070.0
platformAlignment: 8

Any thoughts?
Thank you.
Jan 31 2016
parent reply ref2401 <refactor24 gmail.com> writes:
On Sunday, 31 January 2016 at 14:48:34 UTC, ref2401 wrote:
 I am getting runtime error: 
 core.exception.AssertError std\experimental\allocator\building_b
ocks\region.d(235): Assertion failure
At least tell me can anyone replicate it?
Feb 01 2016
next sibling parent Marc =?UTF-8?B?U2Now7x0eg==?= <schuetzm gmx.net> writes:
On Monday, 1 February 2016 at 12:05:53 UTC, ref2401 wrote:
 On Sunday, 31 January 2016 at 14:48:34 UTC, ref2401 wrote:
 I am getting runtime error: 
 core.exception.AssertError std\experimental\allocator\building_b
ocks\region.d(235): Assertion failure
At least tell me can anyone replicate it?
Missing imports for c&p: import std.experimental.allocator; import std.experimental.allocator.building_blocks; I can't reproduce it on Linux x86_64, neither with latest DMD from git, nor DMD 2.070.0. It's the following assert, maybe it helps finding the cause: https://github.com/D-Programming-Language/phobos/blob/master/std/experimental/allocator/building_blocks/region.d#L235
Feb 01 2016
prev sibling next sibling parent reply mark_mcs <mark mnetcs.com> writes:
On Monday, 1 February 2016 at 12:05:53 UTC, ref2401 wrote:
 On Sunday, 31 January 2016 at 14:48:34 UTC, ref2401 wrote:
 I am getting runtime error: 
 core.exception.AssertError std\experimental\allocator\building_b
ocks\region.d(235): Assertion failure
At least tell me can anyone replicate it?
Reproduced on Windows 7 Pro x64 and Windows 10 Pro x64, DMD 2.070 and 2.069.2. I don't have any 32-bit machines to test. I'll try and debug later.
Feb 01 2016
parent mark_mcs <mark mnetcs.com> writes:
On Monday, 1 February 2016 at 19:55:26 UTC, mark_mcs wrote:
 On Monday, 1 February 2016 at 12:05:53 UTC, ref2401 wrote:
 On Sunday, 31 January 2016 at 14:48:34 UTC, ref2401 wrote:
 I am getting runtime error: 
 core.exception.AssertError std\experimental\allocator\building_b
ocks\region.d(235): Assertion failure
At least tell me can anyone replicate it?
Reproduced on Windows 7 Pro x64 and Windows 10 Pro x64, DMD 2.070 and 2.069.2. I don't have any 32-bit machines to test. I'll try and debug later.
This should fail on 64-bit Linux builds. import std.experimental.allocator; import std.experimental.allocator.building_blocks; void main(string[] args) { ubyte[1024] memory; auto alloc = Region!NullAllocator(memory); auto result = alloc.allocate(20); alloc.expand(result, 20); }
Feb 01 2016
prev sibling parent mark_mcs <mark mnetcs.com> writes:
On Monday, 1 February 2016 at 12:05:53 UTC, ref2401 wrote:
 On Sunday, 31 January 2016 at 14:48:34 UTC, ref2401 wrote:
 I am getting runtime error: 
 core.exception.AssertError std\experimental\allocator\building_b
ocks\region.d(235): Assertion failure
At least tell me can anyone replicate it?
https://issues.dlang.org/show_bug.cgi?id=15637 (Sorry for the *triple* post).
Feb 01 2016