~ubuntu-branches/ubuntu/natty/glib2.0/natty

« back to all changes in this revision

Viewing changes to docs/reference/glib/html/glib-Memory-Slices.html

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2011-03-08 13:28:27 UTC
  • mfrom: (1.59.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20110308132827-odxdwb2fdtji2avm
Tags: 2.28.2-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
<p>
73
73
To achieve these goals, the slice allocator uses a sophisticated,
74
74
layered design that has been inspired by Bonwick's slab allocator
75
 
<sup>[<a name="id520048" href="#ftn.id520048" class="footnote">6</a>]</sup>.
 
75
<sup>[<a name="id702649" href="#ftn.id702649" class="footnote">6</a>]</sup>.
76
76
It uses <code class="function">posix_memalign()</code> to optimize allocations of many equally-sized
77
77
chunks, and has per-thread free lists (the so-called magazine layer)
78
78
to quickly satisfy allocation requests of already known structure sizes.
93
93
object size used at allocation time is still available when freeing.
94
94
</p>
95
95
<div class="example">
96
 
<a name="id488814"></a><p class="title"><b>Example 15. Using the slice allocator</b></p>
 
96
<a name="id524327"></a><p class="title"><b>Example 15. Using the slice allocator</b></p>
97
97
<div class="example-contents">
98
98
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
99
99
    <tbody>
135
135
 
136
136
</div>
137
137
<br class="example-break"><div class="example">
138
 
<a name="id444348"></a><p class="title"><b>Example 16. Using the slice allocator with data structures</b></p>
 
138
<a name="id585291"></a><p class="title"><b>Example 16. Using the slice allocator with data structures</b></p>
139
139
<div class="example-contents">
140
140
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
141
141
    <tbody>
472
472
</div>
473
473
<div class="footnotes">
474
474
<br><hr width="100" align="left">
475
 
<div class="footnote"><p><sup>[<a id="ftn.id520048" href="#id520048" class="para">6</a>] </sup>
 
475
<div class="footnote"><p><sup>[<a id="ftn.id702649" href="#id702649" class="para">6</a>] </sup>
476
476
<a class="ulink" href="http://citeseer.ist.psu.edu/bonwick94slab.html" target="_top">[Bonwick94]</a> Jeff Bonwick, The slab allocator: An object-caching kernel
477
477
memory allocator. USENIX 1994, and
478
478
<a class="ulink" href="http://citeseer.ist.psu.edu/bonwick01magazines.html" target="_top">[Bonwick01]</a> Bonwick and Jonathan Adams, Magazines and vmem: Extending the