Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-10

Dynamic memory in a DLL

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

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