[fpc-devel] Managed Types, Undefined Bhaviour

Michael Van Canneyt michael at freepascal.org
Fri Jun 29 17:07:07 CEST 2018



On Fri, 29 Jun 2018, Mattias Gaertner wrote:

>> Pressed send too quickly.
>> 
>> home:~> ./tirc 
>> Chain: 00007FA5948CF040
>> Chain: 00007FA5948CF040
>> Done: 00007FA5948CF040
>
> "stdcall" is wrong for Linux. It must be
> {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
>
> Then you get under Linux:
> Addref: 00007F0B935BF040 Refcount: 1 at 000000000041331A
> Addref: 00007F0B935BF040 Refcount: 2 at 00000000004121F2
> Release: 00007F0B935BF040 Refcount: 2 at 0000000000412196
> Chain: 00007F0B935BF040
> Addref: 00007F0B935BF040 Refcount: 2 at 000000000041331A
> Addref: 00007F0B935BF040 Refcount: 3 at 00000000004121F2
> Release: 00007F0B935BF040 Refcount: 3 at 0000000000412196
> Chain: 00007F0B935BF040
> Addref: 00007F0B935BF040 Refcount: 3 at 000000000041331A
> Addref: 00007F0B935BF040 Refcount: 4 at 00000000004121F2
> Release: 00007F0B935BF040 Refcount: 4 at 0000000000412196
> Done: 00007F0B935BF040
> fin
> Release: 00007F0B935BF040 Refcount: 3 at 0000000000412196
> Release: 00007F0B935BF040 Refcount: 2 at 0000000000412196
> Release: 00007F0B935BF040 Refcount: 1 at 0000000000412196

ahahahahahaha... Good point. Changed it and now I get this too.

Explains a lot. Strange the compiler does not warn about this. 
("hides method of parent class" or somesuch)

With that out of the way, the original question still remains:

what does this demo actually demonstrate other than that the compiler functions ?

Michael.



More information about the fpc-devel mailing list