Page 1 of 1

Problem in arrayM resp. memoryAccessor

Posted: 14 Feb 2016 13:27
by Martin Meyer
Hello Thomas,

please check below code. It throws an access violation (in VIP 7.5.0.2).

Regards
Martin

Code: Select all

open core   domains     d = d(integer16).   clauses     run() :-         ArM = arrayM::newNonAtomic(1),         ArM:set(0, d(1)),         D = ArM:get(0),         stdIo::write(D).

Posted: 14 Feb 2016 15:56
by Martin Meyer
Please also have a look at the enclosed project. It contains a modified version of arrayM named dynArrayM. I am not sure, whether its memory access is correct and optimal, but it does not throw that exception.

Whenever the array's field type is nonatomic, dynArrayM allocates space of size of domain pointer (i.e. 4 resp. 8 bytes) for every field. Is that wasteful?

Many regards
Martin

Posted: 15 Feb 2016 10:36
by Thomas Linder Puls
Hi, Martin. We will look at the problem.