[fpc-pascal] Dynamic memory in a DLL

gmjimen at burdjia.com gmjimen at burdjia.com
Tue Oct 2 15:14:24 CEST 2007


Hello everybody.

I'm not sure if this is a FPC issue but I need to ask.

Last year I coded an small and simple virtual machine in C. Yesterday I put
that VM in a DLL file and I wrote a Pascal wrapper. It worked nice but
suddenly the program starts to return EAccesViolation exceptions just when it
creates the object to store the script to be executed by the VM. That was
yesterday.

This morning I'm doing a trace and I found that the Access Violation is raised
from the "malloc" function, but It raises the error only if the total amount
of memory that the object needs is more than 1024bytes!!! And in this project
I need more than this.

May be this is a C-related issue but I'm confused because if I use only C it
works.

I'm using FPC 2.0.4 because I'm using Lazarus and Lazarus 1.0 is near.

Thanks.

Guillermo "Ñuño" Martínez Jiménez





More information about the fpc-pascal mailing list