malloc_test: new module for testing/debugging memory problems
[sip-router] / modules / malloc_test / doc / functions.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 
3    "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <section id="malloc_test.functions" xmlns:xi="http://www.w3.org/2001/XInclude">
6         <sectioninfo>
7         <revhistory>
8                 <revision>
9                 <revnumber>$Revision$</revnumber>
10                 <date>$Date$</date>
11                 </revision>
12         </revhistory>
13         </sectioninfo>
14
15         <title>Functions</title>
16
17         <section id="malloc_test.mt_mem_alloc">
18                 <title><function>mt_mem_alloc(size)</function></title>
19                 <para>
20                         Allocates size bytes.
21                 </para>
22                 <note><para>This is a debugging function for simulating memory
23                                         leaks or stressing the memory allocator. It should not
24                                         be used in production setups
25                 </para></note>
26                 <example>
27                         <title><function>men_alloc</function> usage</title>
28                         <programlisting>
29 ...
30 mem_alloc(1048576); # 1MB
31 ...
32                         </programlisting>
33                 </example>
34         </section>
35
36         <section id="malloc_test.mt_mem_free">
37                 <title><function>mt_mem_free()</function></title>
38                 <para>
39                         Frees all the memory allocated with mem_alloc() up to this
40                         point.
41                 </para>
42                 <note><para>This is a debugging function for simulating memory
43                                         leaks or stressing the memory allocator. It should not
44                                         be used in production setups
45                 </para></note>
46                 <example>
47                         <title><function>mem_free</function> usage</title>
48                         <programlisting>
49 ...
50 mem_free();
51 ...
52                         </programlisting>
53                 </example>
54         </section>
55
56 </section>