Re: [fpc-pascal] Custom NewInstance allocator

2024-06-05 Thread Olivier Sannier via fpc-pascal
Could it be because you do not zero out the allocated memory? Le 04/06/2024 à 10꞉54, Hairy Pixels via fpc-pascal a écrit : In the manual it athttps://www.freepascal.org/docs-html/ref/refse38.html it says "Calling the constructor will provoke a call to the virtual class method NewInstance, wh

Re: [fpc-pascal] Type-casting a class variable

2024-05-02 Thread Olivier Sannier via fpc-pascal
Hello, You should cast to TWindowClass as TWindow is used to cast an instance, not a class reference. Note that you may not have TWindowClass, in which case you need to declare it like this: type     TWindowClass = class of TWindow; Note that CreateNewWindow would have to be virtual for de

Re: [fpc-pascal] FillChar/FillByte and Finalize()

2016-03-15 Thread Olivier Sannier
On 15/03/2016 22:14, Krzysztof wrote: Hi, Should I (and in which case) call Finalize() when using FillChar/FillByte? Heaptrc unit is not detecting any memory leak. For example: type PMyRec = ^TMyRec; TMyRec = record Field1: Int64; Field2: String; Field3: Int64; Field4: St

[fpc-pascal] EControlC instead of EZeroDivide when using SSE instructions

2012-08-20 Thread Olivier SANNIER
Hello all, I'm using FreePascal 2.6.0 under Win32 here and I'm seeing a very weird behavior as I'm not getting EZeroDivide when doing float divisions, but a rather surprising EControlC. As I was writing the code in assembly, I also tried with plain Pascal code, but I get the same result. Here is t

[fpc-pascal] Setting string to be UnicodeString by default

2012-05-15 Thread Olivier Sannier
Hello all, Is there a way to force the string type to be an alias to UnicodeString instead of AnsiString as it is by default? I tried the obvious "type string = UnicodeString" but of course it is not allowed as string is a reserved keyword. Regards