<?xml version="1.0"?>
<form>
<bugnb>
1349
</bugnb>
<subject>
Storage allocation error in Aldor Interpreter
</subject>
<description>
The bug arises when I try to run smptest13.as below.

....smptest13.as.....

#include "basicmath"
import from Timer;

test():() == {
  gc := gcTimer()$Timer;
  reset!(gc);
}

test();

....................

I got below error messages:

#1 (Fatal Error) Storage allocation error (atempt to free unknown space).
#1 (Warning) Removing file `smptest13.ao'.
#2 (Fatal Error) Storage allocation error (atempt to free unknown space).


I've found the reason of the bug:

In the Interpreter, the type of three elements of struct gcTimer() is  "union dataObject", which size is 8 bytes. However, the size of each element of gcTimer() in "store.c" is 4 only (long). As a result, the foam code of "reset!(gc)" writes new values to the static variable "heapEnd" behind the gcTimer(), that is wrong positon.It causes heapEnd <heapStart.

But I have not a solution yet.
</description>
<workaround>
dk
</workaround>
<wadescr>

</wadescr>
<priority>
3
</priority>
<bugfile>
/aldor.org/website/bugs/bugreport_1349/timer.as
</bugfile>
<cmdline>
aldor -GInterp -lbasicmath -y$BMROOT/lib smptest13.as
</cmdline>
<version>
1.0.0
</version>
<email>
jcai@orcca.on.ca
</email>
<inform>
yes
</inform>
<design>
dk
</design>
<typeinf>
dk
</typeinf>
<parsing>
dk
</parsing>
<memory>
yes
</memory>
<optimlvl>
dk
</optimlvl>
<libaldor>
dk
</libaldor>
<algebra>
dk
</algebra>
</form>
