<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body smarttemplateinserted="true">
<div id="smartTemplate4-template">Hi<br>
<br>
i have found the problem<br>
<br>
<p>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">views.inc(4318,17) Error: Wrong number of parameters specified for call to "$copy" </pre>
</blockquote>
</p>
<p><br>
</p>
<p>that is not what it says<br>
</p>
It has nothing to do with the parameters. FPC generates this
message if no matching callable function is not found for any
reason<br>
</div>
<div><br>
</div>
<div>In this case because "copy" was not public in the record. I can
set a flag [cnf_ignore_visibility] in the compiler<br>
<br>
<br>
</div>
<div><br>
</div>
<br>
<div><br>
Bye,<br>
Benito <br>
</div>
<div class="moz-cite-prefix">On 23.07.23 16:35, Hairy Pixels via
fpc-devel wrote:<br>
</div>
<blockquote type="cite"
cite="mid:1DDDB621-CBF0-4D4F-9519-899027ABF3DB@gmail.com">
<pre class="moz-quote-pre" wrap="">
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">On Jul 23, 2023, at 7:13 AM, Benito van der Zander via fpc-devel <a class="moz-txt-link-rfc2396E" href="mailto:fpc-devel@lists.freepascal.org"><fpc-devel@lists.freepascal.org></a> wrote:
with my patch, "copy" can be inlined!
initialize and finalize some times, too.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Amazing!
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
There are two places that call them. compiler/nld.pas and compiler/ngenutil.pas where it creates the call nodes. There my patch turns them into ordinary function calls, which can be inlined like any other function call.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
This is the "old way" you describe. Why did they do it like this instead of normal function calls which could be inlined? I suspect one of the compiler devs needs to explain this because there may be a reason.
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Then there is compiler/hlcgobj.pas, which calls initialize/finalize for local or temporary variables. That appears to happen after the inlining is done. Perhaps it needs to do the inlining first to know which variables are there, and afterwards it could not change them anymore.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
So the inlining caused extra init/finalize calls? That's not good for sure. There's already a problem with an extra copy operator being called on temporary memory which can make or break the feature entirely depending on your usage.
Regards,
Ryan Joseph
_______________________________________________
fpc-devel maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel">https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a>
</pre>
</blockquote>
</body>
</html>