This file is indexed.

/usr/share/gtk-doc/html/libvips/libvips-memory.html is in libvips-doc 8.4.5-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>memory: VIPS Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="VIPS Reference Manual">
<link rel="up" href="ch02.html" title="Core VIPS API">
<link rel="prev" href="libvips-error.html" title="error">
<link rel="next" href="VipsRegion.html" title="VipsRegion">
<meta name="generator" content="GTK-Doc V1.25 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#libvips-memory.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="libvips-error.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="VipsRegion.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libvips-memory"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libvips-memory.top_of_page"></a>memory</span></h2>
<p>memory — memory utilities</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libvips-memory.stability-level"></a><h2>Stability Level</h2>
<acronym title="The intention of a Stable interface is to enable arbitrary third parties to
develop applications to these interfaces, release them, and have confidence that
they will run on all minor releases of the product (after the one in which the
interface was introduced, and within the same major release). Even at a major
release, incompatible changes are expected to be rare, and to have strong
justifications.
"><span class="acronym">Stable</span></acronym>, unless otherwise indicated
</div>
<div class="refsect1">
<a name="libvips-memory.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libvips-memory.html#VIPS-FREEF:CAPS" title="VIPS_FREEF()">VIPS_FREEF</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libvips-memory.html#VIPS-FREE:CAPS" title="VIPS_FREE()">VIPS_FREE</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libvips-memory.html#VIPS-SETSTR:CAPS" title="VIPS_SETSTR()">VIPS_SETSTR</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libvips-memory.html#VIPS-NEW:CAPS" title="VIPS_NEW()">VIPS_NEW</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libvips-memory.html#VIPS-ARRAY:CAPS" title="VIPS_ARRAY()">VIPS_ARRAY</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span> *
</td>
<td class="function_name">
<a class="link" href="libvips-memory.html#vips-malloc" title="vips_malloc ()">vips_malloc</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="libvips-memory.html#vips-strdup" title="vips_strdup ()">vips_strdup</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libvips-memory.html#vips-free" title="vips_free ()">vips_free</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libvips-memory.html#vips-tracked-free" title="vips_tracked_free ()">vips_tracked_free</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span> *
</td>
<td class="function_name">
<a class="link" href="libvips-memory.html#vips-tracked-malloc" title="vips_tracked_malloc ()">vips_tracked_malloc</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="libvips-memory.html#vips-tracked-get-mem" title="vips_tracked_get_mem ()">vips_tracked_get_mem</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">size_t</span>
</td>
<td class="function_name">
<a class="link" href="libvips-memory.html#vips-tracked-get-mem-highwater" title="vips_tracked_get_mem_highwater ()">vips_tracked_get_mem_highwater</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libvips-memory.html#vips-tracked-get-allocs" title="vips_tracked_get_allocs ()">vips_tracked_get_allocs</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libvips-memory.html#vips-tracked-open" title="vips_tracked_open ()">vips_tracked_open</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libvips-memory.html#vips-tracked-close" title="vips_tracked_close ()">vips_tracked_close</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libvips-memory.html#vips-tracked-get-files" title="vips_tracked_get_files ()">vips_tracked_get_files</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libvips-memory.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;vips/vips.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="libvips-memory.description"></a><h2>Description</h2>
<p>These functions cover two main areas.</p>
<p>First, some simple utility functions over the underlying
<code class="function">g_malloc()</code>/<code class="function">g_free()</code> functions. Memory allocated and freeded using these
functions is interchangeable with any other glib library.</p>
<p>Second, a pair of functions, <a class="link" href="libvips-memory.html#vips-tracked-malloc" title="vips_tracked_malloc ()"><code class="function">vips_tracked_malloc()</code></a> and <a class="link" href="libvips-memory.html#vips-tracked-free" title="vips_tracked_free ()"><code class="function">vips_tracked_free()</code></a>,
which are NOT compatible. If you <code class="function">g_free()</code> memory that has been allocated
with <a class="link" href="libvips-memory.html#vips-tracked-malloc" title="vips_tracked_malloc ()"><code class="function">vips_tracked_malloc()</code></a> you will see crashes. </p>
<p>The tracked functions are
only suitable for large allocations internal to the library, for example
pixel buffers. libvips watches the total amount of live tracked memory and
uses this information to decide when to trim caches.</p>
</div>
<div class="refsect1">
<a name="libvips-memory.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="VIPS-FREEF:CAPS"></a><h3>VIPS_FREEF()</h3>
<pre class="programlisting">#define             VIPS_FREEF( F, S )</pre>
</div>
<hr>
<div class="refsect2">
<a name="VIPS-FREE:CAPS"></a><h3>VIPS_FREE()</h3>
<pre class="programlisting">#define VIPS_FREE( S ) VIPS_FREEF( g_free, (S) );
</pre>
</div>
<hr>
<div class="refsect2">
<a name="VIPS-SETSTR:CAPS"></a><h3>VIPS_SETSTR()</h3>
<pre class="programlisting">#define             VIPS_SETSTR( S, V )</pre>
</div>
<hr>
<div class="refsect2">
<a name="VIPS-NEW:CAPS"></a><h3>VIPS_NEW()</h3>
<pre class="programlisting">#define             VIPS_NEW( OBJ, T )</pre>
<p>Allocate memory for a thing of type <em class="parameter"><code>T</code></em>
. The memory is not
cleared. </p>
<p>This macro cannot fail. See <a class="link" href="libvips-memory.html#vips-tracked-malloc" title="vips_tracked_malloc ()"><code class="function">vips_tracked_malloc()</code></a> if you are 
allocating large amounts of memory.</p>
<p>See also: <a class="link" href="libvips-memory.html#vips-malloc" title="vips_malloc ()"><code class="function">vips_malloc()</code></a>.</p>
<div class="refsect3">
<a name="VIPS-NEW.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>OBJ</p></td>
<td class="parameter_description"><p>allocate memory local to <em class="parameter"><code>OBJ</code></em>
, or <code class="literal">NULL</code> for no auto-free</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>T</p></td>
<td class="parameter_description"><p>type of thing to allocate</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="VIPS-NEW.returns"></a><h4>Returns</h4>
<p> A pointer of type <em class="parameter"><code>T</code></em>
*.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="VIPS-ARRAY:CAPS"></a><h3>VIPS_ARRAY()</h3>
<pre class="programlisting">#define             VIPS_ARRAY( OBJ, N, T )</pre>
<p>Allocate memory for an array of objects of type <em class="parameter"><code>T</code></em>
. The memory is not
cleared. </p>
<p>This macro cannot fail. See <a class="link" href="libvips-memory.html#vips-tracked-malloc" title="vips_tracked_malloc ()"><code class="function">vips_tracked_malloc()</code></a> if you are 
allocating large amounts of memory.</p>
<p>See also: <a class="link" href="libvips-memory.html#vips-malloc" title="vips_malloc ()"><code class="function">vips_malloc()</code></a>.</p>
<div class="refsect3">
<a name="VIPS-ARRAY.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>OBJ</p></td>
<td class="parameter_description"><p>allocate memory local to <em class="parameter"><code>OBJ</code></em>
, or <code class="literal">NULL</code> for no auto-free</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>N</p></td>
<td class="parameter_description"><p>number of <em class="parameter"><code>T</code></em>
's to allocate</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>T</p></td>
<td class="parameter_description"><p>type of thing to allocate</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="VIPS-ARRAY.returns"></a><h4>Returns</h4>
<p> A pointer of type <em class="parameter"><code>T</code></em>
*.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-malloc"></a><h3>vips_malloc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> *
vips_malloc (<em class="parameter"><code><a class="link" href="VipsObject.html" title="VipsObject"><span class="type">VipsObject</span></a> *object</code></em>,
             <em class="parameter"><code><span class="type">size_t</span> size</code></em>);</pre>
<p>g_malloc() local to <em class="parameter"><code>object</code></em>
, that is, the memory will be automatically 
freed for you when the object is closed. If <em class="parameter"><code>object</code></em>
 is <code class="literal">NULL</code>, you need to 
free the memory explicitly with <code class="function">g_free()</code>.</p>
<p>This function cannot fail. See <a class="link" href="libvips-memory.html#vips-tracked-malloc" title="vips_tracked_malloc ()"><code class="function">vips_tracked_malloc()</code></a> if you are 
allocating large amounts of memory.</p>
<p>See also: <a class="link" href="libvips-memory.html#vips-tracked-malloc" title="vips_tracked_malloc ()"><code class="function">vips_tracked_malloc()</code></a>.</p>
<div class="refsect3">
<a name="vips-malloc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>object</p></td>
<td class="parameter_description"><p>allocate memory local to this <a class="link" href="VipsObject.html" title="VipsObject"><span class="type">VipsObject</span></a>, or <code class="literal">NULL</code></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>number of bytes to allocate</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="vips-malloc.returns"></a><h4>Returns</h4>
<p> a pointer to the allocated memory. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-strdup"></a><h3>vips_strdup ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
vips_strdup (<em class="parameter"><code><a class="link" href="VipsObject.html" title="VipsObject"><span class="type">VipsObject</span></a> *object</code></em>,
             <em class="parameter"><code>const <span class="type">char</span> *str</code></em>);</pre>
<p>g_strdup() a string. When <em class="parameter"><code>object</code></em>
 is freed, the string will be freed for
you.  If <em class="parameter"><code>object</code></em>
 is <code class="literal">NULL</code>, you need to 
free the memory yourself with <code class="function">g_free()</code>.</p>
<p>This function cannot fail. </p>
<p>See also: <a class="link" href="libvips-memory.html#vips-malloc" title="vips_malloc ()"><code class="function">vips_malloc()</code></a>.</p>
<div class="refsect3">
<a name="vips-strdup.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>object</p></td>
<td class="parameter_description"><p>allocate memory local to this <a class="link" href="VipsObject.html" title="VipsObject"><span class="type">VipsObject</span></a>, or <code class="literal">NULL</code></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>string to copy</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="vips-strdup.returns"></a><h4>Returns</h4>
<p> a pointer to the allocated memory. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-free"></a><h3>vips_free ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_free (<em class="parameter"><code><span class="type">void</span> *buf</code></em>);</pre>
<p>Frees memory with <code class="function">g_free()</code> and returns 0. Handy for callbacks.</p>
<p>See also: <a class="link" href="libvips-memory.html#vips-malloc" title="vips_malloc ()"><code class="function">vips_malloc()</code></a>.</p>
<div class="refsect3">
<a name="vips-free.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>memory to free</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="vips-free.returns"></a><h4>Returns</h4>
<p> 0</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-tracked-free"></a><h3>vips_tracked_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
vips_tracked_free (<em class="parameter"><code><span class="type">void</span> *s</code></em>);</pre>
<p>Only use it to free
memory that was previously allocated with <a class="link" href="libvips-memory.html#vips-tracked-malloc" title="vips_tracked_malloc ()"><code class="function">vips_tracked_malloc()</code></a> with a 
<code class="literal">NULL</code> first argument.</p>
<p>See also: <a class="link" href="libvips-memory.html#vips-tracked-malloc" title="vips_tracked_malloc ()"><code class="function">vips_tracked_malloc()</code></a>.</p>
<div class="refsect3">
<a name="vips-tracked-free.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>s</p></td>
<td class="parameter_description"><p> memory to free. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-tracked-malloc"></a><h3>vips_tracked_malloc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> *
vips_tracked_malloc (<em class="parameter"><code><span class="type">size_t</span> size</code></em>);</pre>
<p>Allocate an area of memory that will be tracked by <a class="link" href="libvips-memory.html#vips-tracked-get-mem" title="vips_tracked_get_mem ()"><code class="function">vips_tracked_get_mem()</code></a>
and friends. </p>
<p>If allocation fails, <a class="link" href="libvips-memory.html#vips-malloc" title="vips_malloc ()"><code class="function">vips_malloc()</code></a> returns <code class="literal">NULL</code> and 
sets an error message.</p>
<p>You must only free the memory returned with <a class="link" href="libvips-memory.html#vips-tracked-free" title="vips_tracked_free ()"><code class="function">vips_tracked_free()</code></a>.</p>
<p>See also: <a class="link" href="libvips-memory.html#vips-tracked-free" title="vips_tracked_free ()"><code class="function">vips_tracked_free()</code></a>, <a class="link" href="libvips-memory.html#vips-malloc" title="vips_malloc ()"><code class="function">vips_malloc()</code></a>.</p>
<div class="refsect3">
<a name="vips-tracked-malloc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>number of bytes to allocate</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="vips-tracked-malloc.returns"></a><h4>Returns</h4>
<p> a pointer to the allocated memory, or <code class="literal">NULL</code> on error. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-tracked-get-mem"></a><h3>vips_tracked_get_mem ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
vips_tracked_get_mem (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Returns the number of bytes currently allocated via <a class="link" href="libvips-memory.html#vips-malloc" title="vips_malloc ()"><code class="function">vips_malloc()</code></a> and
friends. vips uses this figure to decide when to start dropping cache, see
<a class="link" href="VipsOperation.html" title="VipsOperation"><span class="type">VipsOperation</span></a>.</p>
<div class="refsect3">
<a name="vips-tracked-get-mem.returns"></a><h4>Returns</h4>
<p> the number of currently allocated bytes</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-tracked-get-mem-highwater"></a><h3>vips_tracked_get_mem_highwater ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span>
vips_tracked_get_mem_highwater (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Returns the largest number of bytes simultaneously allocated via 
<a class="link" href="libvips-memory.html#vips-tracked-malloc" title="vips_tracked_malloc ()"><code class="function">vips_tracked_malloc()</code></a>. Handy for estimating max memory requirements for a
program.</p>
<div class="refsect3">
<a name="vips-tracked-get-mem-highwater.returns"></a><h4>Returns</h4>
<p> the largest number of currently allocated bytes</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-tracked-get-allocs"></a><h3>vips_tracked_get_allocs ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_tracked_get_allocs (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Returns the number of active allocations.</p>
<div class="refsect3">
<a name="vips-tracked-get-allocs.returns"></a><h4>Returns</h4>
<p> the number of active allocations</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-tracked-open"></a><h3>vips_tracked_open ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_tracked_open (<em class="parameter"><code>const <span class="type">char</span> *pathname</code></em>,
                   <em class="parameter"><code><span class="type">int</span> flags</code></em>,
                   <em class="parameter"><code>...</code></em>);</pre>
<p>Exactly as open(2), but the number of files current open via
<a class="link" href="libvips-memory.html#vips-tracked-open" title="vips_tracked_open ()"><code class="function">vips_tracked_open()</code></a> is available via <a class="link" href="libvips-memory.html#vips-tracked-get-files" title="vips_tracked_get_files ()"><code class="function">vips_tracked_get_files()</code></a>. This is used
by the vips operation cache to drop cache when the number of files
available is low.</p>
<p>You must only close the file descriptor with <a class="link" href="libvips-memory.html#vips-tracked-close" title="vips_tracked_close ()"><code class="function">vips_tracked_close()</code></a>.</p>
<p>See also: <a class="link" href="libvips-memory.html#vips-tracked-close" title="vips_tracked_close ()"><code class="function">vips_tracked_close()</code></a>, <a class="link" href="libvips-memory.html#vips-tracked-get-files" title="vips_tracked_get_files ()"><code class="function">vips_tracked_get_files()</code></a>.</p>
<div class="refsect3">
<a name="vips-tracked-open.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>pathname</p></td>
<td class="parameter_description"><p>name of file to open</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>flags for <code class="function">open()</code></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p>open mode</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="vips-tracked-open.returns"></a><h4>Returns</h4>
<p> a file descriptor, or -1 on error.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-tracked-close"></a><h3>vips_tracked_close ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_tracked_close (<em class="parameter"><code><span class="type">int</span> fd</code></em>);</pre>
<p>Exactly as close(2), but update the number of files currently open via
<a class="link" href="libvips-memory.html#vips-tracked-get-files" title="vips_tracked_get_files ()"><code class="function">vips_tracked_get_files()</code></a>. This is used
by the vips operation cache to drop cache when the number of files
available is low.</p>
<p>You must only close file descriptors opened with <a class="link" href="libvips-memory.html#vips-tracked-open" title="vips_tracked_open ()"><code class="function">vips_tracked_open()</code></a>.</p>
<p>See also: <a class="link" href="libvips-memory.html#vips-tracked-open" title="vips_tracked_open ()"><code class="function">vips_tracked_open()</code></a>, <a class="link" href="libvips-memory.html#vips-tracked-get-files" title="vips_tracked_get_files ()"><code class="function">vips_tracked_get_files()</code></a>.</p>
<div class="refsect3">
<a name="vips-tracked-close.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>fd</p></td>
<td class="parameter_description"><p>file to <code class="function">close()</code></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="vips-tracked-close.returns"></a><h4>Returns</h4>
<p> a file descriptor, or -1 on error.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="vips-tracked-get-files"></a><h3>vips_tracked_get_files ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
vips_tracked_get_files (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Returns the number of open files.</p>
<div class="refsect3">
<a name="vips-tracked-get-files.returns"></a><h4>Returns</h4>
<p> the number of open files</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="libvips-memory.other_details"></a><h2>Types and Values</h2>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25</div>
</body>
</html>