Hi,
Is there any or can we have a?HEAPTRACE?IFDEF so we can do something like this :
if FileExists('heap.trc') then DeleteFile('heap.trc'); SetHeapTraceOutput('heap.trc');
Regards,
Ara

Mailing lists / lazarus / 2016-05
10 messages · 5 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi,
Is there any or can we have a?HEAPTRACE?IFDEF so we can do something like this :
if FileExists('heap.trc') then DeleteFile('heap.trc'); SetHeapTraceOutput('heap.trc');
Regards,
Ara
My bad, I missed this?http://bugs.freepascal.org/view.php?id=24681
But as it marked as "no change required" but I cant understand why we cant benefit from something like this that have an internal option in project option but we cant control to save the output without defining an internal define for project?!
I think using heaptrc unit without this option is not useful enough because showing a program hep output in a message box is not even readable!
Regards,
Ara
AFAIK, it's because it's not technically possible.
Use {$IF DECLARED(useheaptrace)} in your main project file (just like lazarus.pp uses it).
Ondrej
AFAIK, it's because it's not technically possible.
As an amateur can I ask why?
Use {$IF DECLARED(useheaptrace)} in your main project file (just like lazarus.pp uses it).
Very interesting! I didnt know this ability,Thanks. How it works? what key names it has?
But it has a problem, if you use this define IDE wont color it properly like you use normal defines, it that case it if define is not true it will pale.
Regards,
Ara
We do have documentation, you know. Is it so much to ask to look at it ?
http://www.freepascal.org/docs-html/current/prog/progsu128.html
But it has a problem, if you use this define IDE wont color it properly like you use normal defines, it that case it if define is not true it will pale.
The IDE cannot do this, since it is known only when the compiler is invoked.
Michael.
As an amateur can I ask why? Very interesting! I didnt know this ability,Thanks. How it…
UseHeapTrace is a variable in unit heaptrc, which is silently used when compiling with -gh.
But it has a problem, if you use this define IDE wont color it properly like you use normal defines, it that case it if define is not true it will pale.
$IF DECLARED is not supported by codetools.
Mattias
We do have documentation, you know. Is it so much to ask to look at it ? http://www.freepascal.org/docs-html/current/prog/progsu128.html
No it is not but it is not came to my searches and FPC documentation is not much good for searching at least from google and if I know what I want I couldn't guess there is such like this ability and one way I will be left to know about this is that is reading doc for fun everyday like a book and keep reading it's changelog!
UseHeapTrace is a variable in unit heaptrc, which is silently used when compiling with -gh.
Thanks for the explanation.
$IF DECLARED is not supported by codetools.
Should I report it as a bug or it already reported?
Regards,
Ara
As an amateur can I ask why? Very interesting! I didnt know this ability,Thanks. How it…
"Aradeonas" wrote> > AFAIK, it's because it's not technically possible. As an amateur can I ask why?
Because -gh does not trigger the recompilation of used units as internally it basically only adds another unit to the main program's uses clause. Thus any define for the presence of the heaptrace unit would only work in the main program file and there you use the variant with declared() anyway...
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20160503/ec343caa/attachment.html>
No it is not but it is not came to my searches and FPC documentation is not much good for…
I don't know what you typed in Google, but it definitely shows it:
Google search:
"conditional compilation free pascal"
Entry 4. But entries 1-3 also will lead you the answer.
And the documentation changes only once per release. No-one asks you to read it daily.
IMHO it is useless to report it for this case.
As I tried to explain: it cannot be done *correct* by the codetools.
It depends, for example, on actual compiler options. So, in case of lazarus, it depends on build modes. It can also depend on @someconfig.cfg compiler options files. etc.
At best, the codetools can make a guess.
Michael.
Thanks for the explanation?Michael but I didnt have an idea about this ability.
Regards,
Ara