File: group__qfits__memory.html

package info (click to toggle)
qfits 6.2.0-9
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,012 kB
  • sloc: ansic: 11,633; sh: 8,330; makefile: 131
file content (534 lines) | stat: -rw-r--r-- 23,557 bytes parent folder | download | duplicates (5)
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
<html>
<head>
<meta name="keywords"           content="eso, FITS format, C library">
<link href="doxygen.css" rel="stylesheet" type="text/css">
<title>QFITS Reference Manual 6.2.0</title>
</head>

<body text="#000000" bgcolor="#ffffff">



<!-- Generated by Doxygen 1.4.1 -->
<h1>POSIX-compatible extended memory handling</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__memory.html#ga0">qfits_memory_malloc</a> (size_t size, const char *filename, int lineno)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocate memory.  <a href="#ga0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__memory.html#ga1">qfits_memory_calloc</a> (size_t nmemb, size_t size, const char *filename, int lineno)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocate memory.  <a href="#ga1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__memory.html#ga2">qfits_memory_falloc</a> (char *name, size_t offs, size_t *size, const char *srcname, int srclin)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Map a file's contents to memory as a char pointer.  <a href="#ga2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__memory.html#ga3">qfits_memory_fdealloc</a> (void *ptr, size_t offs, size_t size, const char *filename, int lineno)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Free memory that has been allocated with falloc.  <a href="#ga3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__memory.html#ga4">qfits_memory_free</a> (void *ptr, const char *filename, int lineno)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Free memory.  <a href="#ga4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__memory.html#ga5">qfits_memory_realloc</a> (void *ptr, size_t size, const char *filename, int lineno)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Re-Allocate memory.  <a href="#ga5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__memory.html#ga6">qfits_memory_strdup</a> (const char *s, const char *filename, int lineno)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Duplicate a string using calloc.  <a href="#ga6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__memory.html#ga7">qfits_memory_status</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Display memory status information.  <a href="#ga7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__memory.html#ga8">qfits_memory_is_empty</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Tell if there is still some memory allocated.  <a href="#ga8"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
qfits_memory is a small and efficient module offering memory extension capabitilies to ANSI C programs running on POSIX-compliant systems. It offers several useful features such as memory leak detection, protection for free on NULL or unallocated pointers, and virtually unlimited memory space. qfits_memory requires the <code>mmap()</code> system call to be implemented in the local C library to function. This module has been tested on a number of current Unix * flavours and is reported to work fine. The current limitation is the limited number of pointers it can handle at the same time. <hr><h2>Function Documentation</h2>
<a class="anchor" name="ga1" doxytag="qfits_memory.c::qfits_memory_calloc"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void* qfits_memory_calloc           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">size_t&nbsp;</td>
          <td class="mdname" nowrap> <em>nmemb</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>size_t&nbsp;</td>
          <td class="mdname" nowrap> <em>size</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>filename</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>lineno</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Allocate memory. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>nmemb</em>&nbsp;</td><td>Number of elements to allocate. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>Size (in bytes) of each element. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>filename</em>&nbsp;</td><td>Name of the file where the alloc took place. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>lineno</em>&nbsp;</td><td>Line number in the file. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>1 newly allocated pointer.</dd></dl>
This function is a replacement call for calloc. It should never be called directly but through a macro instead, as:<p>
<div class="fragment"><pre class="fragment">  <a class="code" href="group__qfits__memory.html#ga1">qfits_memory_calloc</a>(nmemb, size, __FILE__, __LINE__)
</pre></div>     </td>
  </tr>
</table>
<a class="anchor" name="ga2" doxytag="qfits_memory.c::qfits_memory_falloc"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">char* qfits_memory_falloc           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">char *&nbsp;</td>
          <td class="mdname" nowrap> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>size_t&nbsp;</td>
          <td class="mdname" nowrap> <em>offs</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>size_t *&nbsp;</td>
          <td class="mdname" nowrap> <em>size</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>srcname</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>srclin</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Map a file's contents to memory as a char pointer. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>Name of the file to map </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>offs</em>&nbsp;</td><td>Offset to the first mapped byte in file. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>Returned size of the mapped file in bytes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>srcname</em>&nbsp;</td><td>Name of the source file making the call. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>srclin</em>&nbsp;</td><td>Line # where the call was made. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>A pointer to char, to be freed using <a class="el" href="group__qfits__memory.html#ga4">qfits_memory_free()</a>.</dd></dl>
This function takes in input the name of a file. It tries to map the file into memory and if it succeeds, returns the file's contents as a char pointer. It also modifies the input size variable to be the size of the mapped file in bytes. This function is normally never directly called but through the falloc() macro.<p>
The offset indicates the starting point for the mapping, i.e. if you are not interested in mapping the whole file but only from a given place.<p>
The returned pointer ptr must be deallocated with qfits_memory_fdealloc(ptr)     </td>
  </tr>
</table>
<a class="anchor" name="ga3" doxytag="qfits_memory.c::qfits_memory_fdealloc"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void qfits_memory_fdealloc           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void *&nbsp;</td>
          <td class="mdname" nowrap> <em>ptr</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>size_t&nbsp;</td>
          <td class="mdname" nowrap> <em>offs</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>size_t&nbsp;</td>
          <td class="mdname" nowrap> <em>size</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>filename</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>lineno</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Free memory that has been allocated with falloc. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ptr</em>&nbsp;</td><td>Pointer to free. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>offs</em>&nbsp;</td><td>Offset to the first mapped byte in file. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>size to unmap </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>filename</em>&nbsp;</td><td>Name of the file where the dealloc took place. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>lineno</em>&nbsp;</td><td>Line number in the file. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>void </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga4" doxytag="qfits_memory.c::qfits_memory_free"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void qfits_memory_free           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void *&nbsp;</td>
          <td class="mdname" nowrap> <em>ptr</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>filename</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>lineno</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Free memory. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ptr</em>&nbsp;</td><td>Pointer to free. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>filename</em>&nbsp;</td><td>Name of the file where the dealloc took place. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>lineno</em>&nbsp;</td><td>Line number in the file. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>void</dd></dl>
Free the memory associated to a given pointer. Prints out a warning on stderr if the requested pointer is NULL or cannot be found in the extended memory table.     </td>
  </tr>
</table>
<a class="anchor" name="ga8" doxytag="qfits_memory.c::qfits_memory_is_empty"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">int qfits_memory_is_empty           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Tell if there is still some memory allocated. 
<p>
<dl compact><dt><b>Returns:</b></dt><dd>1 if the memory table is tempty, 0 if no, -1 if the memory model is off </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga0" doxytag="qfits_memory.c::qfits_memory_malloc"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void* qfits_memory_malloc           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">size_t&nbsp;</td>
          <td class="mdname" nowrap> <em>size</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>filename</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>lineno</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Allocate memory. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>Size (in bytes) to allocate. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>filename</em>&nbsp;</td><td>Name of the file where the alloc took place. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>lineno</em>&nbsp;</td><td>Line number in the file. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>1 newly allocated pointer.</dd></dl>
This function is a replacement call for malloc. It should never be called directly but through a macro instead, as:<p>
<div class="fragment"><pre class="fragment">  <a class="code" href="group__qfits__memory.html#ga0">qfits_memory_malloc</a>(size, __FILE__, __LINE__)
</pre></div>     </td>
  </tr>
</table>
<a class="anchor" name="ga5" doxytag="qfits_memory.c::qfits_memory_realloc"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void* qfits_memory_realloc           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void *&nbsp;</td>
          <td class="mdname" nowrap> <em>ptr</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>size_t&nbsp;</td>
          <td class="mdname" nowrap> <em>size</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>filename</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>lineno</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Re-Allocate memory. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ptr</em>&nbsp;</td><td>Pointer to free. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>Size (in bytes) to allocate. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>filename</em>&nbsp;</td><td>Name of the file where the alloc took place. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>lineno</em>&nbsp;</td><td>Line number in the file. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>1 newly allocated pointer.</dd></dl>
This function is a replacement call for realloc. It should never be called directly but through a macro instead, as:<p>
<div class="fragment"><pre class="fragment">  <a class="code" href="group__qfits__memory.html#ga5">qfits_memory_realloc</a>(nmemb, size, __FILE__, __LINE__)
</pre></div>     </td>
  </tr>
</table>
<a class="anchor" name="ga7" doxytag="qfits_memory.c::qfits_memory_status"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void qfits_memory_status           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Display memory status information. 
<p>
<dl compact><dt><b>Returns:</b></dt><dd>void</dd></dl>
This function is meant for debugging purposes, but it is recommended to call it at the end of every executable making use of the extended memory features.     </td>
  </tr>
</table>
<a class="anchor" name="ga6" doxytag="qfits_memory.c::qfits_memory_strdup"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">char* qfits_memory_strdup           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>s</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>filename</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>lineno</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Duplicate a string using calloc. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>String to duplicate. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>filename</em>&nbsp;</td><td>Name of the file where the call took place. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>lineno</em>&nbsp;</td><td>Line number in the file. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>1 newly allocated character string.</dd></dl>
This function calls in turn calloc to perform the allocation. It should never be called directly but only through a macro, like:<p>
<div class="fragment"><pre class="fragment">  <a class="code" href="group__qfits__memory.html#ga6">qfits_memory_strdup</a>(s, __FILE__, __LINE__)
</pre></div><p>
This function calls <a class="el" href="group__qfits__memory.html#ga0">qfits_memory_malloc()</a> to do the allocation.     </td>
  </tr>
</table>

</body>
</html>