[fpc-pascal] Problems with GetMem
dhkblaszyk at zeelandnet.nl
Sun Apr 10 21:32:15 CEST 2011
On Apr 10, 2011, at 3:38 PM, Jonas Maebe wrote:
> On 10 Apr 2011, at 15:02, Darius Blaszyk wrote:
>> You're right that there seems to be a memleak somewhere, but it's something strange, heaptrc reports 1 unfreed block and 0bytes unfreed. Never seen this before.
> It's because you have memory corruption. Then heaptrc cannot give accurate statistics.
>> I will test with valgrind this afternoon to see if I can get some wiser from it.
>> BTW, for those interested, I ported some code that allows bitmapped freetype fonts be used in OpenGL this works a lot simpler than using the freetype support from fcl-image. If you wish you can find the code here: http://scandraid.svn.sourceforge.net/viewvc/scandraid/src/branches/font/
>> Marked memory at $0A5AF068 invalid
>> Wrong signature $9BC362D6 instead of D1853A22
>> $00401948 KEYPRESSED, line 80 of BitmappedGLFont.pas
> This shows that you have memory corruption somewhere ("Marked memory at ... invalid").
Valgrind made it possible to solve the memory corruption bug. It appeared that I just did not reserve enough for the textures. After solving this, the SIGSEGV also disappeared like you predicted. Thanks Jonas!
More information about the fpc-pascal