1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
<title>PyPy Configuration[translation.backendopt.mallocs] </title>
5
<meta content="text/html;charset=ISO-8859-1" name="Content-Type"/>
6
<link href="../style.css" media="screen" rel="stylesheet" type="text/css"/></head>
8
<div><a><img alt="PyPy" height="110" id="pyimg" src="http://codespeak.net/pypy/img/py-web1.png" width="149"/></a></div>
10
<div class="project_title">PyPy Configuration[translation.backendopt.mallocs] </div>
11
<div id="menubar"><a class="menu" href="../index.html">general documentation</a> <a class="menu" href="index.html">config index</a> <a class="menu" href="commandline.html">command-line overview</a> </div></div>
12
<div id="contentspace">
13
<div id="docinfoline">
14
<div style="float: right; font-style: italic;"> </div></div>
15
<div class="document" id="translation-backendopt-mallocs">
16
<h1 class="title">translation.backendopt.mallocs</h1>
18
<div class="contents topic">
19
<p class="topic-title first"><a id="contents" name="contents">Contents</a></p>
21
<li><a class="reference" href="#basic-option-information" id="id1" name="id1">Basic Option Information</a></li>
22
<li><a class="reference" href="#description" id="id2" name="id2">Description</a></li>
25
<p><a class="reference" href="translation.backendopt.html">back to parent</a></p>
27
<h1><a class="toc-backref" href="#id1" id="basic-option-information" name="basic-option-information">Basic Option Information</a></h1>
29
<li><strong>name:</strong> mallocs</li>
30
<li><strong>description:</strong> Remove mallocs</li>
31
<li><strong>command-line:</strong> --translation-backendopt-mallocs</li>
32
<li><strong>command-line for negation:</strong> --no-translation-backendopt-mallocs</li>
33
<li><strong>option type:</strong> boolean option</li>
34
<li><strong>default:</strong> True</li>
38
<h1><a class="toc-backref" href="#id2" id="description" name="description">Description</a></h1>
39
<p>This optimization enables "malloc removal", which "explodes"
40
allocations of structures which do not escape from the function they
41
are allocated in into one or more additional local variables.</p>
42
<p>An example. Consider this rather unlikely seeming code:</p>
43
<pre class="literal-block">
51
<p>Malloc removal will spot that the <tt class="docutils literal"><span class="pre">C</span></tt> object can never leave <tt class="docutils literal"><span class="pre">f</span></tt>
52
and replace the above with code like this:</p>
53
<pre class="literal-block">
58
<p>It is rare for code to be directly written in a way that allows this
59
optimization to be useful, but inlining often results in opportunities
60
for its use (and indeed, this is one of the main reasons PyPy does its
61
own inlining rather than relying on the C compilers).</p>
62
<p>For much more information about this and other optimizations you can
63
read section 4.1 of the technical report on "Massive Parallelism and
64
Translation Aspects" which you can find on the <a class="reference" href="../index-report.html">Technical reports page</a>.</p>
b'\\ No newline at end of file'