Discussions related to Visual Prolog
Martin Meyer
VIP Member
Posts: 296
Joined: 14 Nov 2002 0:01

Problem in arrayM resp. memoryAccessor

Unread post 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).
Martin Meyer
VIP Member
Posts: 296
Joined: 14 Nov 2002 0:01

Unread post 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
Attachments
DynArrayM.zip
(8.52 KiB) Downloaded 360 times
User avatar
Thomas Linder Puls
VIP Member
Posts: 1232
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

Hi, Martin. We will look at the problem.
Regards Thomas Linder Puls
PDC
Post Reply