Am 19.10.2026 um 14:17 schrieb Adriaan van Os via fpc-pascal:
Consider the following test program:
program symbols;
var
stat: TFPCHeapStatus;
begin
stat := GetFPCHeapStatus;
writeln( 'FPC FPCHeapStatus.CurrHeapUsed = ', stat.CurrHeapFree)
end.
When I compile it with -XX- -Xs, there is a string "TFPCHeapStatus" in
a Mach-O (__TEXT, __const) section. When I compile it with -XX, the
string "TFPCHeapStatus" in not in that same Mach-O (__TEXT,
__const) section, nor anywhere else. Is that expected behaviour ? And
how do I get rid of unnecessary symbols like "TFPCHeapStatus" when not
smart-linking ?
The string "TFPCHeapStatus" is from the RTTI for the record. Considering
that you're not using it (e.g. by using "TypeInfo(TFPCHeapStatus)"),
smart linking will detect that and not link it in, that's the purpose of
smart linking after all. Without smart linking all such identifiers will
be linked in. This is by design.
Regards,
Sven
_______________________________________________
fpc-pascal maillist - [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal