Talk:Java performance: Difference between revisions

Content deleted Content added
syntaxhighlight & fix lint
 
Line 60:
While Java may be able to do escape analysis more often than C++, it can be used sometimes in C++. For example the following code:
 
<syntaxhighlight lang="text">
<code>
class Bar {
int inc(int i) { return i + 1 }
Line 70:
delete b;
}
</syntaxhighlight>
</code>
 
with this code the compiler can know, that b will never be used outside of the function foo. I agree that pointers make escape analysis harder, but under certain conditions the compiler can verify that varibles do not escape a funciton. BTW, I have not programmed in C++ in a long time. Thus I may have made some syntactic errors.