<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>I am using heapmgr but with trunk compiler the value of
__heapsize is plain wrong (and way too big)</p>
<p>When I compile my code with my old compiler for pico all is fine,
when I debug into heapmgr I see that __heapsize is set correctly
to 16384 based on this setting:</p>
<p>program spi_st7789;<br>
{$MODE OBJFPC}<br>
{$H+}<br>
{$MEMORY 16384,16384}<br>
<br>
</p>
<p>When I use current main compiler the value is 308528 which is
more than available memory, this is why I found the issue....<br>
</p>
<p><br>
</p>
<p>The reason for this is that a line from my original code for
linkerfile generation was not included:</p>
<p> Add(' *(.data .data.*)');<br>
// Special Section for the Raspberry Pico, needed for
linking to spi<br>
<b> Add(' *(.time_critical*)');<br>
</b> Add(' KEEP (*(.fpc .fpc.n_version .fpc.n_links))');<br>
Add(' _edata = .;');</p>
<p><br>
</p>
<p>and for that reason the content of that section in loaded to
start of flash (and during startup to ram) instead of the correct
data for __heapsize</p>
<p>Was there a reason for leaving this out when my code was merged
to main?</p>
<p><br>
</p>
<p>I guess no, so I will create a PR to fix this issue, please
comment when there was a reason for leaving this out.<br>
</p>
<p><br>
</p>
<p>Michael<br>
</p>
</body>
</html>