parent
d5d59ad634
commit
56235a28ce
|
@ -505,14 +505,14 @@ library. There are two problems with this:</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>The time to run the static c'tors impacts startup time of
|
<li>The time to run the static c'tors impacts startup time of
|
||||||
applications—a critical time for gui apps.</li>
|
applications—a critical time for GUI apps.</li>
|
||||||
<li>The static c'tors cause the app to pull many extra pages of memory off the
|
<li>The static c'tors cause the app to pull many extra pages of memory off the
|
||||||
disk: both the code for the static c'tors in each .o file and the small
|
disk: both the code for the static c'tors in each <tt>.o</tt> file and the
|
||||||
amount of data that gets touched. In addition, touched/dirty pages put
|
small amount of data that gets touched. In addition, touched/dirty pages
|
||||||
more pressure on the VM system on low-memory machines.</li>
|
put more pressure on the VM system on low-memory machines.</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<div style="align: center">
|
<div align="center">
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -527,7 +527,7 @@ library. There are two problems with this:</p>
|
||||||
<td align="left"><pre>DEBUG(std::cerr << ...);
|
<td align="left"><pre>DEBUG(std::cerr << ...);
|
||||||
DEBUG(dump(std::cerr));</pre></td>
|
DEBUG(dump(std::cerr));</pre></td>
|
||||||
<td align="left"><pre>DOUT << ...;
|
<td align="left"><pre>DOUT << ...;
|
||||||
dump(DOUT);</pre></td>
|
DEBUG(dump(DOUT));</pre></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left"><pre>std::cerr << "Hello world\n";</pre></td>
|
<td align="left"><pre>std::cerr << "Hello world\n";</pre></td>
|
||||||
|
@ -557,17 +557,17 @@ dump(DOUT);</pre></td>
|
||||||
<td align="left"><pre>void print(std::ostream &Out);
|
<td align="left"><pre>void print(std::ostream &Out);
|
||||||
// ...
|
// ...
|
||||||
print(std::cerr);</pre></td>
|
print(std::cerr);</pre></td>
|
||||||
<td align="left"><pre>void print(std::ostream &Out);
|
<td align="left"><pre>void print(llvm::OStream Out);<sup>1</sup>
|
||||||
void print(std::ostream *Out) { if (Out) print(*Out) }
|
|
||||||
// ...
|
// ...
|
||||||
print(llvm::cerr);</pre>
|
print(llvm::cerr);</pre>
|
||||||
|
|
||||||
|
</td> </tbody> </table>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="doc_text">
|
<div class="doc_text">
|
||||||
<i>N.B.</i> The second <tt>print</tt> method is called by the <tt>print</tt>
|
<p><sup>1</sup><tt>llvm::OStream</tt> is a light-weight class so it should never
|
||||||
expression. It prevents the execution of the first <tt>print</tt> method if the
|
be passed by reference. This is important because in some configurations,
|
||||||
stream is <tt>cnull</tt>.</div></td>
|
<tt>DOUT</tt> is an rvalue.</p>
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue