Re: [fpc-pascal] RE: Getmem -> Move -> Freemem

2009-04-26 Thread Jonas Maebe
On 26 Apr 2009, at 23:15, Guillermo Martínez Jiménez wrote: Now it fails trying to copy 998846 bytes. If I put an "IF fSize < 90 THEN..." to prevent move more than 90 bytes it does work and I'm sure it moves up to 206737 bytes. But "size" is LONGINT so IIRC it should be able to copy ~2G

[fpc-pascal] RE: Getmem -> Move -> Freemem

2009-04-26 Thread Guillermo Martínez Jiménez
> Both are .dat and fdata are points. IOW you are moving "fsize" bytes from > the place where the 4 byte of the pointer dat is stored to the place where > the 4 bytes of the pointer fdata is stored. Since you probably move more > than 4 bytes you totally corrupt what is behind "fdata" in memory. >

[fpc-pascal] Re: How to use fpcmake

2009-04-26 Thread Guillermo Martínez Jiménez
> From: Graeme Geldenhuys > Subject: Re: [fpc-pascal] How to use fpcmake > > Hi Guillermo, > > I struggled with it as well. Henry Vermaak then created an example for > me and showed how to use it. The example he did was for the fpGUI > Toolkit project. I did read Vermaak's example and I've found

Re: [fpc-pascal] Getmem -> Move -> Freemem

2009-04-26 Thread Marco van de Voort
In our previous episode, Guillermo Mart?nez Jim?nez said: > fSize := aObject^.size; > GetMem (fData, fSize); > Move (aObject^.dat, fData, fSize); > > Both "fData" and "dat" are untyped POINTER but the program returns an > "Segment violation" at the Move procedure. I've checked the pointers >

[fpc-pascal] Getmem -> Move -> Freemem

2009-04-26 Thread Guillermo Martínez Jiménez
Hello. I'm using FPC 2.2.2 on Xubuntu 8.10. I need to reserve dynamic memory to store raw binary data. I tried the next code:  fSize := aObject^.size;  GetMem (fData, fSize);  Move (aObject^.dat, fData, fSize); Both "fData" and "dat" are untyped POINTER but the program returns an "Segment vi

[fpc-pascal] Getmem -> Move -> Freemem

2009-04-26 Thread Guillermo Martínez Jiménez
Hello. I'm using I need to reserve dynamic memory to store raw binary data. I tried the next code: fSize := aObject^.size; GetMem (fData, fSize); Move (aObject^.dat, fData, fSize); Both "fData" and "dat" are untyped POINTER but the program returns an "Segment violation" at the Move procedu