[processor-sdk/performance-audio-sr.git] / psdk_cust / libarch_k2g_1_0_1_0 / docs / doxygen / latex / d7 / da6 / group__libarch__memmgt.tex
1 \hypertarget{group__libarch__memmgt}{\section{Memory Management A\-P\-I}
2 \label{group__libarch__memmgt}\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}}
3 }
6 Error return codes of memory management functions.
9 \subsection*{Data Structures}
10 \begin{DoxyCompactItemize}
11 \item
12 struct \hyperlink{structlib__memdscr__str}{lib\-\_\-memdscr\-\_\-str}
13 \begin{DoxyCompactList}\small\item\em Memory descriptor structure. \end{DoxyCompactList}\end{DoxyCompactItemize}
14 \subsection*{Macros}
15 \begin{DoxyCompactItemize}
16 \item
17 \#define \hyperlink{group__libarch__memmgt_gacfa30c2c1e697da904265b91b9c60d2f}{L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-S\-U\-C\-C\-E\-S\-S}~(0)
18 \item
19 \#define \hyperlink{group__libarch__memmgt_ga21728661e7141fcfd212ca8286a7947b}{L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-E\-R\-R\-O\-R}~(-\/1)
20 \end{DoxyCompactItemize}
21 \subsection*{Typedefs}
22 \begin{DoxyCompactItemize}
23 \item
24 typedef struct \hyperlink{structlib__memdscr__str}{lib\-\_\-memdscr\-\_\-str} \hyperlink{group__libarch__memmgt_ga933f44304562f9591104d57b7868ebc3}{lib\-\_\-memdscr\-\_\-t}
25 \begin{DoxyCompactList}\small\item\em Memory descriptor structure. \end{DoxyCompactList}\end{DoxyCompactItemize}
26 \subsection*{Enumerations}
27 \begin{DoxyCompactItemize}
28 \item
29 enum \{ \\*
30 \hyperlink{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55ba98a90dd78f7e0d087e7d9c66505011c7}{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-V\-F\-A\-S\-T} = 0,
31 \hyperlink{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55ba0554f0354c84251e347c0ee79ffe046d}{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-F\-A\-S\-T},
32 \hyperlink{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55bab6e0c7570cd8f2ada826e36d607d8abb}{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-M\-E\-D},
33 \hyperlink{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55badc4290cb2bdcc915f3156f39ce3ea361}{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-S\-L\-O\-W},
34 \\*
35 \hyperlink{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55ba5e2798bb86ffcd081fbd1a7fad3571a2}{L\-I\-B\-\_\-\-P\-M\-E\-M\-\_\-\-M\-E\-D},
36 \hyperlink{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55ba106f7b37f3b11574158123d265359eeb}{L\-I\-B\-\_\-\-P\-M\-E\-M\-\_\-\-S\-L\-O\-W},
37 \hyperlink{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55ba1cb4f966271cb92f79ba8229136f3a70}{L\-I\-B\-\_\-\-M\-E\-M\-T\-Y\-P\-E\-\_\-\-N}
38 \}
39 \begin{DoxyCompactList}\small\item\em Memory types in terms of speed and volatility. \end{DoxyCompactList}\end{DoxyCompactItemize}
40 \subsection*{Functions}
41 \begin{DoxyCompactItemize}
42 \item
43 int \hyperlink{group__libarch__memmgt_gaeeb7c8294fcd4640e4eaf7a741397032}{lib\-\_\-smem\-\_\-vinit} (void $\ast$handle, void $\ast$base, size\-\_\-t size)
44 \begin{DoxyCompactList}\small\item\em Function lib\-\_\-smem\-\_\-vinit performs necessary initialization for the very fast scratch heap memory allocation. \end{DoxyCompactList}\item
45 int \hyperlink{group__libarch__memmgt_gadd591cf0185afae77c89e62a35af6395}{lib\-\_\-smem\-\_\-finit} (void $\ast$handle, void $\ast$base, size\-\_\-t size)
46 \begin{DoxyCompactList}\small\item\em Function lib\-\_\-smem\-\_\-finit performs necessary initialization for the fast scratch heap memory allocation. \end{DoxyCompactList}\item
47 int \hyperlink{group__libarch__memmgt_ga991a1c6d4b40f4b4750c7fd1f8aa73f6}{lib\-\_\-smem\-\_\-minit} (void $\ast$handle, void $\ast$base, size\-\_\-t size)
48 \begin{DoxyCompactList}\small\item\em Function lib\-\_\-smem\-\_\-minit performs necessary initialization for the medium speed scratch heap memory allocation. \end{DoxyCompactList}\item
49 int \hyperlink{group__libarch__memmgt_ga1dd9ae589bdfe68ced145885ea4c4789}{lib\-\_\-smem\-\_\-sinit} (void $\ast$handle, void $\ast$base, size\-\_\-t size)
50 \begin{DoxyCompactList}\small\item\em Function lib\-\_\-smem\-\_\-sinit performs necessary initialization for the slow scratch heap memory allocation. \end{DoxyCompactList}\item
51 void $\ast$ \hyperlink{group__libarch__memmgt_ga24093174e441c683650863236dcb9806}{lib\-\_\-smem\-\_\-valloc} (void $\ast$handle, size\-\_\-t size, size\-\_\-t align)
52 \begin{DoxyCompactList}\small\item\em Function lib\-\_\-smem\-\_\-valloc allocates a memory block from the very fast scratch heap. It will also align the allocated memory block as requested. \end{DoxyCompactList}\item
53 void $\ast$ \hyperlink{group__libarch__memmgt_ga51d763b1f89ef58e83cb9e4bc7546ba8}{lib\-\_\-smem\-\_\-falloc} (void $\ast$handle, size\-\_\-t size, size\-\_\-t align)
54 \begin{DoxyCompactList}\small\item\em Function lib\-\_\-smem\-\_\-falloc allocates a memory block from the fast scratch heap. It will also align the address of the allocated memory block as requested. \end{DoxyCompactList}\item
55 void $\ast$ \hyperlink{group__libarch__memmgt_gaac0047f2fe5ce1dfad45fc0333d906dc}{lib\-\_\-smem\-\_\-malloc} (void $\ast$handle, size\-\_\-t size, size\-\_\-t align)
56 \begin{DoxyCompactList}\small\item\em Function lib\-\_\-smem\-\_\-malloc allocates a memory block from the medium speed scratch heap. It will also align the address of the allocated memory block as requested. \end{DoxyCompactList}\item
57 void $\ast$ \hyperlink{group__libarch__memmgt_ga08b73e8bf61fb50e20e08f7df4de636b}{lib\-\_\-smem\-\_\-salloc} (void $\ast$handle, size\-\_\-t size, size\-\_\-t align)
58 \begin{DoxyCompactList}\small\item\em Function lib\-\_\-smem\-\_\-salloc allocates a memory block from the slow scratch heap. It will also align the address of the allocated memory block as requested. \end{DoxyCompactList}\item
59 int \hyperlink{group__libarch__memmgt_ga65c30f7a20c6e359df9d73db0c9078c1}{lib\-\_\-smem\-\_\-vreset} (void $\ast$handle)
60 \begin{DoxyCompactList}\small\item\em Function lib\-\_\-smem\-\_\-vreset resets the very fast scratch heap and destroys all allocated memory blocks in it. \end{DoxyCompactList}\item
61 int \hyperlink{group__libarch__memmgt_ga18470bba549f0d9c4a6d98a1f615b8c2}{lib\-\_\-smem\-\_\-freset} (void $\ast$handle)
62 \begin{DoxyCompactList}\small\item\em Function lib\-\_\-smem\-\_\-freset resets the fast scratch heap and destroys all allocated memory blocks in it. \end{DoxyCompactList}\item
63 int \hyperlink{group__libarch__memmgt_ga38dbf46a5af66e691ba20ffb61f9932e}{lib\-\_\-smem\-\_\-mreset} (void $\ast$handle)
64 \begin{DoxyCompactList}\small\item\em Function lib\-\_\-smem\-\_\-mreset resets the medium speed scratch heap and destroys all allocated memory blocks in it. \end{DoxyCompactList}\item
65 int \hyperlink{group__libarch__memmgt_gaa3fb30e824c80ec62d4e7847f292108f}{lib\-\_\-smem\-\_\-sreset} (void $\ast$handle)
66 \begin{DoxyCompactList}\small\item\em Function lib\-\_\-smem\-\_\-mreset resets the slow scratch heap and destroys all allocated memory blocks in it. \end{DoxyCompactList}\item
67 static void $\ast$ \hyperlink{group__libarch__memmgt_gaeae499cb566d6411b938107d3ffeb144}{lib\-\_\-pmem\-\_\-malloc} (void $\ast$handle, size\-\_\-t size, size\-\_\-t align)
68 \begin{DoxyCompactList}\small\item\em Function lib\-\_\-pmem\-\_\-malloc allocates a memory block from the medium speed permanent heap. It will also align the address of the allocated memory block as requested. \end{DoxyCompactList}\item
69 static void $\ast$ \hyperlink{group__libarch__memmgt_ga306a1aa220281f0b6d79b12928bfeff8}{lib\-\_\-pmem\-\_\-salloc} (void $\ast$handle, size\-\_\-t size, size\-\_\-t align)
70 \begin{DoxyCompactList}\small\item\em Function lib\-\_\-pmem\-\_\-salloc allocates a memory block from the slow permanent heap. It will also align the address of the allocated memory block as requested. \end{DoxyCompactList}\item
71 static void \hyperlink{group__libarch__memmgt_gafeda2ec3f28d9ebb87a8adcecbb0f414}{lib\-\_\-pmem\-\_\-mfree} (void $\ast$handle, void $\ast$mem\-\_\-ptr)
72 \begin{DoxyCompactList}\small\item\em Refer to \hyperlink{lib__memmgt_8h}{lib\-\_\-memmgt.\-h} for detailed documentation. \end{DoxyCompactList}\item
73 static void \hyperlink{group__libarch__memmgt_gab12e1d41b3d71633c9ab2d8818510f63}{lib\-\_\-pmem\-\_\-sfree} (void $\ast$handle, void $\ast$mem\-\_\-ptr)
74 \begin{DoxyCompactList}\small\item\em Refer to \hyperlink{lib__memmgt_8h}{lib\-\_\-memmgt.\-h} for detailed documentation. \end{DoxyCompactList}\end{DoxyCompactItemize}
77 \subsection{Detailed Description}
78 Error return codes of memory management functions.
80 \subsection{Macro Definition Documentation}
81 \hypertarget{group__libarch__memmgt_ga21728661e7141fcfd212ca8286a7947b}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-E\-R\-R\-O\-R@{L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-E\-R\-R\-O\-R}}
82 \index{L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-E\-R\-R\-O\-R@{L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-E\-R\-R\-O\-R}!Memory Management API@{Memory Management A\-P\-I}}
83 \subsubsection[{L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-E\-R\-R\-O\-R}]{\setlength{\rightskip}{0pt plus 5cm}\#define L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-E\-R\-R\-O\-R~(-\/1)}}\label{group__libarch__memmgt_ga21728661e7141fcfd212ca8286a7947b}
84 Failure. \hypertarget{group__libarch__memmgt_gacfa30c2c1e697da904265b91b9c60d2f}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-S\-U\-C\-C\-E\-S\-S@{L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-S\-U\-C\-C\-E\-S\-S}}
85 \index{L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-S\-U\-C\-C\-E\-S\-S@{L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-S\-U\-C\-C\-E\-S\-S}!Memory Management API@{Memory Management A\-P\-I}}
86 \subsubsection[{L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-S\-U\-C\-C\-E\-S\-S}]{\setlength{\rightskip}{0pt plus 5cm}\#define L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-S\-U\-C\-C\-E\-S\-S~(0)}}\label{group__libarch__memmgt_gacfa30c2c1e697da904265b91b9c60d2f}
87 Success. No error.
89 \subsection{Typedef Documentation}
90 \hypertarget{group__libarch__memmgt_ga933f44304562f9591104d57b7868ebc3}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-memdscr\-\_\-t@{lib\-\_\-memdscr\-\_\-t}}
91 \index{lib\-\_\-memdscr\-\_\-t@{lib\-\_\-memdscr\-\_\-t}!Memory Management API@{Memory Management A\-P\-I}}
92 \subsubsection[{lib\-\_\-memdscr\-\_\-t}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf lib\-\_\-memdscr\-\_\-str} {\bf lib\-\_\-memdscr\-\_\-t}}}\label{group__libarch__memmgt_ga933f44304562f9591104d57b7868ebc3}
95 Memory descriptor structure.
97 \begin{DoxyRemark}{Remarks}
98 The user M\-U\-S\-T define an array of memory descriptors and pass the address of the array to the heap initialization and allocation routines. For example, the memory descriptor array may be defined as\-: \begin{DoxyVerb} lib_memdscr_t libxyz_smem_med;
99 lib_memdscr_t libxyz_smem_fast;
100 lib_memdscr_t libxyz_smem_vfast;
102 lib_memdscr_t * libxyz_memdscr_tab[LIB_MEMTYPE_N] = {
103 &libxyz_smem_vfast,
104 &libxyz_smem_fast,
105 &libxyz_smem_med,
106 NULL // scratch slow memory is not used by libxyz
107 };\end{DoxyVerb}
109 \end{DoxyRemark}
112 \subsection{Enumeration Type Documentation}
113 \hypertarget{group__libarch__memmgt_ga06fc87d81c62e9abb8790b6e5713c55b}{\subsubsection[{anonymous enum}]{\setlength{\rightskip}{0pt plus 5cm}anonymous enum}}\label{group__libarch__memmgt_ga06fc87d81c62e9abb8790b6e5713c55b}
116 Memory types in terms of speed and volatility.
118 \begin{Desc}
119 \item[Enumerator]\par
120 \begin{description}
121 \index{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-V\-F\-A\-S\-T@{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-V\-F\-A\-S\-T}!Memory Management A\-P\-I@{Memory Management A\-P\-I}}\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-V\-F\-A\-S\-T@{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-V\-F\-A\-S\-T}}\item[{\em
122 \hypertarget{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55ba98a90dd78f7e0d087e7d9c66505011c7}{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-V\-F\-A\-S\-T}\label{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55ba98a90dd78f7e0d087e7d9c66505011c7}
123 }]Scratch memory, very fast \index{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-F\-A\-S\-T@{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-F\-A\-S\-T}!Memory Management A\-P\-I@{Memory Management A\-P\-I}}\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-F\-A\-S\-T@{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-F\-A\-S\-T}}\item[{\em
124 \hypertarget{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55ba0554f0354c84251e347c0ee79ffe046d}{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-F\-A\-S\-T}\label{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55ba0554f0354c84251e347c0ee79ffe046d}
125 }]Scratch memory, fast \index{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-M\-E\-D@{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-M\-E\-D}!Memory Management A\-P\-I@{Memory Management A\-P\-I}}\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-M\-E\-D@{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-M\-E\-D}}\item[{\em
126 \hypertarget{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55bab6e0c7570cd8f2ada826e36d607d8abb}{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-M\-E\-D}\label{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55bab6e0c7570cd8f2ada826e36d607d8abb}
127 }]Scratch memory, medium speed \index{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-S\-L\-O\-W@{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-S\-L\-O\-W}!Memory Management A\-P\-I@{Memory Management A\-P\-I}}\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-S\-L\-O\-W@{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-S\-L\-O\-W}}\item[{\em
128 \hypertarget{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55badc4290cb2bdcc915f3156f39ce3ea361}{L\-I\-B\-\_\-\-S\-M\-E\-M\-\_\-\-S\-L\-O\-W}\label{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55badc4290cb2bdcc915f3156f39ce3ea361}
129 }]Scratch memory, slow \index{L\-I\-B\-\_\-\-P\-M\-E\-M\-\_\-\-M\-E\-D@{L\-I\-B\-\_\-\-P\-M\-E\-M\-\_\-\-M\-E\-D}!Memory Management A\-P\-I@{Memory Management A\-P\-I}}\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!L\-I\-B\-\_\-\-P\-M\-E\-M\-\_\-\-M\-E\-D@{L\-I\-B\-\_\-\-P\-M\-E\-M\-\_\-\-M\-E\-D}}\item[{\em
130 \hypertarget{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55ba5e2798bb86ffcd081fbd1a7fad3571a2}{L\-I\-B\-\_\-\-P\-M\-E\-M\-\_\-\-M\-E\-D}\label{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55ba5e2798bb86ffcd081fbd1a7fad3571a2}
131 }]Permanent memory, medium speed \index{L\-I\-B\-\_\-\-P\-M\-E\-M\-\_\-\-S\-L\-O\-W@{L\-I\-B\-\_\-\-P\-M\-E\-M\-\_\-\-S\-L\-O\-W}!Memory Management A\-P\-I@{Memory Management A\-P\-I}}\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!L\-I\-B\-\_\-\-P\-M\-E\-M\-\_\-\-S\-L\-O\-W@{L\-I\-B\-\_\-\-P\-M\-E\-M\-\_\-\-S\-L\-O\-W}}\item[{\em
132 \hypertarget{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55ba106f7b37f3b11574158123d265359eeb}{L\-I\-B\-\_\-\-P\-M\-E\-M\-\_\-\-S\-L\-O\-W}\label{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55ba106f7b37f3b11574158123d265359eeb}
133 }]Permanent memory, slow \index{L\-I\-B\-\_\-\-M\-E\-M\-T\-Y\-P\-E\-\_\-\-N@{L\-I\-B\-\_\-\-M\-E\-M\-T\-Y\-P\-E\-\_\-\-N}!Memory Management A\-P\-I@{Memory Management A\-P\-I}}\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!L\-I\-B\-\_\-\-M\-E\-M\-T\-Y\-P\-E\-\_\-\-N@{L\-I\-B\-\_\-\-M\-E\-M\-T\-Y\-P\-E\-\_\-\-N}}\item[{\em
134 \hypertarget{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55ba1cb4f966271cb92f79ba8229136f3a70}{L\-I\-B\-\_\-\-M\-E\-M\-T\-Y\-P\-E\-\_\-\-N}\label{group__libarch__memmgt_gga06fc87d81c62e9abb8790b6e5713c55ba1cb4f966271cb92f79ba8229136f3a70}
135 }]Total number of types \end{description}
136 \end{Desc}
139 \subsection{Function Documentation}
140 \hypertarget{group__libarch__memmgt_gaeae499cb566d6411b938107d3ffeb144}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-pmem\-\_\-malloc@{lib\-\_\-pmem\-\_\-malloc}}
141 \index{lib\-\_\-pmem\-\_\-malloc@{lib\-\_\-pmem\-\_\-malloc}!Memory Management API@{Memory Management A\-P\-I}}
142 \subsubsection[{lib\-\_\-pmem\-\_\-malloc}]{\setlength{\rightskip}{0pt plus 5cm}static void$\ast$ lib\-\_\-pmem\-\_\-malloc (
143 \begin{DoxyParamCaption}
144 \item[{void $\ast$}]{handle, }
145 \item[{size\-\_\-t}]{size, }
146 \item[{size\-\_\-t}]{align}
147 \end{DoxyParamCaption}
148 )\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{group__libarch__memmgt_gaeae499cb566d6411b938107d3ffeb144}
151 Function lib\-\_\-pmem\-\_\-malloc allocates a memory block from the medium speed permanent heap. It will also align the address of the allocated memory block as requested.
153 \begin{DoxyRemark}{Remarks}
154 In this release, this function simply calls run time support library function memalign().
155 \end{DoxyRemark}
157 \begin{DoxyParams}[1]{Parameters}
158 \mbox{\tt in} & {\em handle} & Pointer to the memory descriptor array defined by the library using this funciton \\
159 \hline
160 \mbox{\tt in} & {\em size} & Size of memory block to be allocated \\
161 \hline
162 \mbox{\tt in} & {\em align} & Alignment. The address of the allocated memory block will be aligned to 2$^\wedge$align bytes.\\
163 \hline
164 \end{DoxyParams}
166 \begin{DoxyRetVals}{Return values}
167 {\em Non-\/\-N\-U\-L\-L} & Address of the allocated memory block \\
168 \hline
169 {\em N\-U\-L\-L} & Failure to allocate memory \\
170 \hline
171 \end{DoxyRetVals}
172 \hypertarget{group__libarch__memmgt_gafeda2ec3f28d9ebb87a8adcecbb0f414}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-pmem\-\_\-mfree@{lib\-\_\-pmem\-\_\-mfree}}
173 \index{lib\-\_\-pmem\-\_\-mfree@{lib\-\_\-pmem\-\_\-mfree}!Memory Management API@{Memory Management A\-P\-I}}
174 \subsubsection[{lib\-\_\-pmem\-\_\-mfree}]{\setlength{\rightskip}{0pt plus 5cm}static void lib\-\_\-pmem\-\_\-mfree (
175 \begin{DoxyParamCaption}
176 \item[{void $\ast$}]{handle, }
177 \item[{void $\ast$}]{mem\-\_\-ptr}
178 \end{DoxyParamCaption}
179 )\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{group__libarch__memmgt_gafeda2ec3f28d9ebb87a8adcecbb0f414}
182 Refer to \hyperlink{lib__memmgt_8h}{lib\-\_\-memmgt.\-h} for detailed documentation.
184 \begin{DoxyRemark}{Remarks}
185 In this release, this function simply calls run time support library function free().
186 \end{DoxyRemark}
188 \begin{DoxyParams}[1]{Parameters}
189 \mbox{\tt in} & {\em handle} & Pointer to the memory descriptor array defined by the library using this funciton \\
190 \hline
191 \mbox{\tt in} & {\em mem\-\_\-ptr} & Pointer to the memory to be freed \\
192 \hline
193 \end{DoxyParams}
194 \hypertarget{group__libarch__memmgt_ga306a1aa220281f0b6d79b12928bfeff8}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-pmem\-\_\-salloc@{lib\-\_\-pmem\-\_\-salloc}}
195 \index{lib\-\_\-pmem\-\_\-salloc@{lib\-\_\-pmem\-\_\-salloc}!Memory Management API@{Memory Management A\-P\-I}}
196 \subsubsection[{lib\-\_\-pmem\-\_\-salloc}]{\setlength{\rightskip}{0pt plus 5cm}static void$\ast$ lib\-\_\-pmem\-\_\-salloc (
197 \begin{DoxyParamCaption}
198 \item[{void $\ast$}]{handle, }
199 \item[{size\-\_\-t}]{size, }
200 \item[{size\-\_\-t}]{align}
201 \end{DoxyParamCaption}
202 )\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{group__libarch__memmgt_ga306a1aa220281f0b6d79b12928bfeff8}
205 Function lib\-\_\-pmem\-\_\-salloc allocates a memory block from the slow permanent heap. It will also align the address of the allocated memory block as requested.
207 \begin{DoxyRemark}{Remarks}
208 In this release, this function simply calls run time support library function memalign().
209 \end{DoxyRemark}
211 \begin{DoxyParams}[1]{Parameters}
212 \mbox{\tt in} & {\em handle} & Pointer to the memory descriptor array defined by the library using this funciton \\
213 \hline
214 \mbox{\tt in} & {\em size} & Size of memory block to be allocated \\
215 \hline
216 \mbox{\tt in} & {\em align} & Alignment. The address of the allocated memory block will be aligned to 2$^\wedge$align bytes.\\
217 \hline
218 \end{DoxyParams}
220 \begin{DoxyRetVals}{Return values}
221 {\em Non-\/\-N\-U\-L\-L} & Address of the allocated memory block \\
222 \hline
223 {\em N\-U\-L\-L} & Failure to allocate memory \\
224 \hline
225 \end{DoxyRetVals}
226 \hypertarget{group__libarch__memmgt_gab12e1d41b3d71633c9ab2d8818510f63}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-pmem\-\_\-sfree@{lib\-\_\-pmem\-\_\-sfree}}
227 \index{lib\-\_\-pmem\-\_\-sfree@{lib\-\_\-pmem\-\_\-sfree}!Memory Management API@{Memory Management A\-P\-I}}
228 \subsubsection[{lib\-\_\-pmem\-\_\-sfree}]{\setlength{\rightskip}{0pt plus 5cm}static void lib\-\_\-pmem\-\_\-sfree (
229 \begin{DoxyParamCaption}
230 \item[{void $\ast$}]{handle, }
231 \item[{void $\ast$}]{mem\-\_\-ptr}
232 \end{DoxyParamCaption}
233 )\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{group__libarch__memmgt_gab12e1d41b3d71633c9ab2d8818510f63}
236 Refer to \hyperlink{lib__memmgt_8h}{lib\-\_\-memmgt.\-h} for detailed documentation.
238 \begin{DoxyRemark}{Remarks}
239 In this release, this function simply calls run time support library function free().
240 \end{DoxyRemark}
242 \begin{DoxyParams}[1]{Parameters}
243 \mbox{\tt in} & {\em handle} & Pointer to the memory descriptor array defined by the library using this funciton \\
244 \hline
245 \mbox{\tt in} & {\em mem\-\_\-ptr} & Pointer to the memory to be freed \\
246 \hline
247 \end{DoxyParams}
248 \hypertarget{group__libarch__memmgt_ga51d763b1f89ef58e83cb9e4bc7546ba8}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-smem\-\_\-falloc@{lib\-\_\-smem\-\_\-falloc}}
249 \index{lib\-\_\-smem\-\_\-falloc@{lib\-\_\-smem\-\_\-falloc}!Memory Management API@{Memory Management A\-P\-I}}
250 \subsubsection[{lib\-\_\-smem\-\_\-falloc}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ lib\-\_\-smem\-\_\-falloc (
251 \begin{DoxyParamCaption}
252 \item[{void $\ast$}]{handle, }
253 \item[{size\-\_\-t}]{size, }
254 \item[{size\-\_\-t}]{align}
255 \end{DoxyParamCaption}
256 )}}\label{group__libarch__memmgt_ga51d763b1f89ef58e83cb9e4bc7546ba8}
259 Function lib\-\_\-smem\-\_\-falloc allocates a memory block from the fast scratch heap. It will also align the address of the allocated memory block as requested.
262 \begin{DoxyParams}[1]{Parameters}
263 \mbox{\tt in} & {\em handle} & Pointer to the memory descriptor array defined by the library using this funciton \\
264 \hline
265 \mbox{\tt in} & {\em size} & Size of memory block to be allocated \\
266 \hline
267 \mbox{\tt in} & {\em align} & Alignment. The address of the allocated memory block will be aligned to 2$^\wedge$align bytes.\\
268 \hline
269 \end{DoxyParams}
271 \begin{DoxyRetVals}{Return values}
272 {\em Non-\/\-N\-U\-L\-L} & Address of the allocated memory block \\
273 \hline
274 {\em N\-U\-L\-L} & Failure to allocate memory\\
275 \hline
276 \end{DoxyRetVals}
277 \begin{DoxyPrecond}{Precondition}
278 Function lib\-\_\-smem\-\_\-finit must be called first before this function can be used to allocate memory.
279 \end{DoxyPrecond}
280 Function lib\-\_\-smem\-\_\-falloc allocates a memory block from the fast scratch heap. It will also align the address of the allocated memory block as requested. \hypertarget{group__libarch__memmgt_gadd591cf0185afae77c89e62a35af6395}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-smem\-\_\-finit@{lib\-\_\-smem\-\_\-finit}}
281 \index{lib\-\_\-smem\-\_\-finit@{lib\-\_\-smem\-\_\-finit}!Memory Management API@{Memory Management A\-P\-I}}
282 \subsubsection[{lib\-\_\-smem\-\_\-finit}]{\setlength{\rightskip}{0pt plus 5cm}int lib\-\_\-smem\-\_\-finit (
283 \begin{DoxyParamCaption}
284 \item[{void $\ast$}]{handle, }
285 \item[{void $\ast$}]{base, }
286 \item[{size\-\_\-t}]{size}
287 \end{DoxyParamCaption}
288 )}}\label{group__libarch__memmgt_gadd591cf0185afae77c89e62a35af6395}
291 Function lib\-\_\-smem\-\_\-finit performs necessary initialization for the fast scratch heap memory allocation.
294 \begin{DoxyParams}[1]{Parameters}
295 \mbox{\tt in} & {\em handle} & Pointer to the memory descriptor array \\
296 \hline
297 \mbox{\tt in} & {\em base} & Base address of the memory to be used as fast scratch \\
298 \hline
299 \mbox{\tt in} & {\em size} & Size of the memory in bytes\\
300 \hline
301 \end{DoxyParams}
303 \begin{DoxyRetVals}{Return values}
304 {\em L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-S\-U\-C\-C\-E\-S\-S} & Success. No error. \\
305 \hline
306 {\em L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-E\-R\-R\-O\-R} & Failure.\\
307 \hline
308 \end{DoxyRetVals}
309 Function lib\-\_\-smem\-\_\-finit performs necessary initialization for the fast scratch heap memory allocation. \hypertarget{group__libarch__memmgt_ga18470bba549f0d9c4a6d98a1f615b8c2}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-smem\-\_\-freset@{lib\-\_\-smem\-\_\-freset}}
310 \index{lib\-\_\-smem\-\_\-freset@{lib\-\_\-smem\-\_\-freset}!Memory Management API@{Memory Management A\-P\-I}}
311 \subsubsection[{lib\-\_\-smem\-\_\-freset}]{\setlength{\rightskip}{0pt plus 5cm}int lib\-\_\-smem\-\_\-freset (
312 \begin{DoxyParamCaption}
313 \item[{void $\ast$}]{handle}
314 \end{DoxyParamCaption}
315 )}}\label{group__libarch__memmgt_ga18470bba549f0d9c4a6d98a1f615b8c2}
318 Function lib\-\_\-smem\-\_\-freset resets the fast scratch heap and destroys all allocated memory blocks in it.
321 \begin{DoxyParams}[1]{Parameters}
322 \mbox{\tt in} & {\em handle} & Pointer to the memory descriptor array defined by the library using this funciton\\
323 \hline
324 \end{DoxyParams}
326 \begin{DoxyRetVals}{Return values}
327 {\em L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-S\-U\-C\-C\-E\-S\-S} & Success. No error. \\
328 \hline
329 {\em L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-E\-R\-R\-O\-R} & Failure.\\
330 \hline
331 \end{DoxyRetVals}
332 \begin{DoxyPrecond}{Precondition}
333 Function lib\-\_\-smem\-\_\-finit must be called first before this function can be called.
334 \end{DoxyPrecond}
335 Function lib\-\_\-smem\-\_\-freset resets the fast scratch heap and destroys all allocated memory blocks in it. \hypertarget{group__libarch__memmgt_gaac0047f2fe5ce1dfad45fc0333d906dc}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-smem\-\_\-malloc@{lib\-\_\-smem\-\_\-malloc}}
336 \index{lib\-\_\-smem\-\_\-malloc@{lib\-\_\-smem\-\_\-malloc}!Memory Management API@{Memory Management A\-P\-I}}
337 \subsubsection[{lib\-\_\-smem\-\_\-malloc}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ lib\-\_\-smem\-\_\-malloc (
338 \begin{DoxyParamCaption}
339 \item[{void $\ast$}]{handle, }
340 \item[{size\-\_\-t}]{size, }
341 \item[{size\-\_\-t}]{align}
342 \end{DoxyParamCaption}
343 )}}\label{group__libarch__memmgt_gaac0047f2fe5ce1dfad45fc0333d906dc}
346 Function lib\-\_\-smem\-\_\-malloc allocates a memory block from the medium speed scratch heap. It will also align the address of the allocated memory block as requested.
349 \begin{DoxyParams}[1]{Parameters}
350 \mbox{\tt in} & {\em handle} & Pointer to the memory descriptor array defined by the library using this funciton \\
351 \hline
352 \mbox{\tt in} & {\em size} & Size of memory block to be allocated \\
353 \hline
354 \mbox{\tt in} & {\em align} & Alignment. The address of the allocated memory block will be aligned to 2$^\wedge$align bytes.\\
355 \hline
356 \end{DoxyParams}
358 \begin{DoxyRetVals}{Return values}
359 {\em Non-\/\-N\-U\-L\-L} & Address of the allocated memory block \\
360 \hline
361 {\em N\-U\-L\-L} & Failure to allocate memory\\
362 \hline
363 \end{DoxyRetVals}
364 \begin{DoxyPrecond}{Precondition}
365 Function lib\-\_\-smem\-\_\-minit must be called first before this function can be used to allocate memory.
366 \end{DoxyPrecond}
367 Function lib\-\_\-smem\-\_\-malloc allocates a memory block from the medium speed scratch heap. It will also align the address of the allocated memory block as requested. \hypertarget{group__libarch__memmgt_ga991a1c6d4b40f4b4750c7fd1f8aa73f6}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-smem\-\_\-minit@{lib\-\_\-smem\-\_\-minit}}
368 \index{lib\-\_\-smem\-\_\-minit@{lib\-\_\-smem\-\_\-minit}!Memory Management API@{Memory Management A\-P\-I}}
369 \subsubsection[{lib\-\_\-smem\-\_\-minit}]{\setlength{\rightskip}{0pt plus 5cm}int lib\-\_\-smem\-\_\-minit (
370 \begin{DoxyParamCaption}
371 \item[{void $\ast$}]{handle, }
372 \item[{void $\ast$}]{base, }
373 \item[{size\-\_\-t}]{size}
374 \end{DoxyParamCaption}
375 )}}\label{group__libarch__memmgt_ga991a1c6d4b40f4b4750c7fd1f8aa73f6}
378 Function lib\-\_\-smem\-\_\-minit performs necessary initialization for the medium speed scratch heap memory allocation.
381 \begin{DoxyParams}[1]{Parameters}
382 \mbox{\tt in} & {\em handle} & Pointer to the memory descriptor array \\
383 \hline
384 \mbox{\tt in} & {\em base} & Base address of the memory to be used as medium scratch \\
385 \hline
386 \mbox{\tt in} & {\em size} & Size of the memory in bytes\\
387 \hline
388 \end{DoxyParams}
390 \begin{DoxyRetVals}{Return values}
391 {\em L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-S\-U\-C\-C\-E\-S\-S} & Success. No error. \\
392 \hline
393 {\em L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-E\-R\-R\-O\-R} & Failure.\\
394 \hline
395 \end{DoxyRetVals}
396 Function lib\-\_\-smem\-\_\-minit performs necessary initialization for the medium speed scratch heap memory allocation. \hypertarget{group__libarch__memmgt_ga38dbf46a5af66e691ba20ffb61f9932e}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-smem\-\_\-mreset@{lib\-\_\-smem\-\_\-mreset}}
397 \index{lib\-\_\-smem\-\_\-mreset@{lib\-\_\-smem\-\_\-mreset}!Memory Management API@{Memory Management A\-P\-I}}
398 \subsubsection[{lib\-\_\-smem\-\_\-mreset}]{\setlength{\rightskip}{0pt plus 5cm}int lib\-\_\-smem\-\_\-mreset (
399 \begin{DoxyParamCaption}
400 \item[{void $\ast$}]{handle}
401 \end{DoxyParamCaption}
402 )}}\label{group__libarch__memmgt_ga38dbf46a5af66e691ba20ffb61f9932e}
405 Function lib\-\_\-smem\-\_\-mreset resets the medium speed scratch heap and destroys all allocated memory blocks in it.
408 \begin{DoxyParams}[1]{Parameters}
409 \mbox{\tt in} & {\em handle} & Pointer to the memory descriptor array defined by the library using this funciton\\
410 \hline
411 \end{DoxyParams}
413 \begin{DoxyRetVals}{Return values}
414 {\em L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-S\-U\-C\-C\-E\-S\-S} & Success. No error. \\
415 \hline
416 {\em L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-E\-R\-R\-O\-R} & Failure.\\
417 \hline
418 \end{DoxyRetVals}
419 \begin{DoxyPrecond}{Precondition}
420 Function lib\-\_\-smem\-\_\-minit must be called first before this function can be called.
421 \end{DoxyPrecond}
422 Function lib\-\_\-smem\-\_\-mreset resets the medium speed scratch heap and destroys all allocated memory blocks in it. \hypertarget{group__libarch__memmgt_ga08b73e8bf61fb50e20e08f7df4de636b}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-smem\-\_\-salloc@{lib\-\_\-smem\-\_\-salloc}}
423 \index{lib\-\_\-smem\-\_\-salloc@{lib\-\_\-smem\-\_\-salloc}!Memory Management API@{Memory Management A\-P\-I}}
424 \subsubsection[{lib\-\_\-smem\-\_\-salloc}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ lib\-\_\-smem\-\_\-salloc (
425 \begin{DoxyParamCaption}
426 \item[{void $\ast$}]{handle, }
427 \item[{size\-\_\-t}]{size, }
428 \item[{size\-\_\-t}]{align}
429 \end{DoxyParamCaption}
430 )}}\label{group__libarch__memmgt_ga08b73e8bf61fb50e20e08f7df4de636b}
433 Function lib\-\_\-smem\-\_\-salloc allocates a memory block from the slow scratch heap. It will also align the address of the allocated memory block as requested.
436 \begin{DoxyParams}[1]{Parameters}
437 \mbox{\tt in} & {\em handle} & Pointer to the memory descriptor array defined by the library using this funciton \\
438 \hline
439 \mbox{\tt in} & {\em size} & Size of memory block to be allocated \\
440 \hline
441 \mbox{\tt in} & {\em align} & Alignment. The address of the allocated memory block will be aligned to 2$^\wedge$align bytes.\\
442 \hline
443 \end{DoxyParams}
445 \begin{DoxyRetVals}{Return values}
446 {\em Non-\/\-N\-U\-L\-L} & Address of the allocated memory block \\
447 \hline
448 {\em N\-U\-L\-L} & Failure to allocate memory\\
449 \hline
450 \end{DoxyRetVals}
451 \begin{DoxyPrecond}{Precondition}
452 Function lib\-\_\-smem\-\_\-sinit must be called first before this function can be used to allocate memory.
453 \end{DoxyPrecond}
454 Function lib\-\_\-smem\-\_\-salloc allocates a memory block from the slow scratch heap. It will also align the address of the allocated memory block as requested. \hypertarget{group__libarch__memmgt_ga1dd9ae589bdfe68ced145885ea4c4789}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-smem\-\_\-sinit@{lib\-\_\-smem\-\_\-sinit}}
455 \index{lib\-\_\-smem\-\_\-sinit@{lib\-\_\-smem\-\_\-sinit}!Memory Management API@{Memory Management A\-P\-I}}
456 \subsubsection[{lib\-\_\-smem\-\_\-sinit}]{\setlength{\rightskip}{0pt plus 5cm}int lib\-\_\-smem\-\_\-sinit (
457 \begin{DoxyParamCaption}
458 \item[{void $\ast$}]{handle, }
459 \item[{void $\ast$}]{base, }
460 \item[{size\-\_\-t}]{size}
461 \end{DoxyParamCaption}
462 )}}\label{group__libarch__memmgt_ga1dd9ae589bdfe68ced145885ea4c4789}
465 Function lib\-\_\-smem\-\_\-sinit performs necessary initialization for the slow scratch heap memory allocation.
468 \begin{DoxyParams}[1]{Parameters}
469 \mbox{\tt in} & {\em handle} & Pointer to the memory descriptor array \\
470 \hline
471 \mbox{\tt in} & {\em base} & Base address of the memory to be used as slow scratch \\
472 \hline
473 \mbox{\tt in} & {\em size} & Size of the memory in bytes\\
474 \hline
475 \end{DoxyParams}
477 \begin{DoxyRetVals}{Return values}
478 {\em L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-S\-U\-C\-C\-E\-S\-S} & Success. No error. \\
479 \hline
480 {\em L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-E\-R\-R\-O\-R} & Failure.\\
481 \hline
482 \end{DoxyRetVals}
483 Function lib\-\_\-smem\-\_\-sinit performs necessary initialization for the slow scratch heap memory allocation. \hypertarget{group__libarch__memmgt_gaa3fb30e824c80ec62d4e7847f292108f}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-smem\-\_\-sreset@{lib\-\_\-smem\-\_\-sreset}}
484 \index{lib\-\_\-smem\-\_\-sreset@{lib\-\_\-smem\-\_\-sreset}!Memory Management API@{Memory Management A\-P\-I}}
485 \subsubsection[{lib\-\_\-smem\-\_\-sreset}]{\setlength{\rightskip}{0pt plus 5cm}int lib\-\_\-smem\-\_\-sreset (
486 \begin{DoxyParamCaption}
487 \item[{void $\ast$}]{handle}
488 \end{DoxyParamCaption}
489 )}}\label{group__libarch__memmgt_gaa3fb30e824c80ec62d4e7847f292108f}
492 Function lib\-\_\-smem\-\_\-mreset resets the slow scratch heap and destroys all allocated memory blocks in it.
495 \begin{DoxyParams}[1]{Parameters}
496 \mbox{\tt in} & {\em handle} & Pointer to the memory descriptor array defined by the library using this funciton\\
497 \hline
498 \end{DoxyParams}
500 \begin{DoxyRetVals}{Return values}
501 {\em L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-S\-U\-C\-C\-E\-S\-S} & Success. No error. \\
502 \hline
503 {\em L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-E\-R\-R\-O\-R} & Failure.\\
504 \hline
505 \end{DoxyRetVals}
506 \begin{DoxyPrecond}{Precondition}
507 Function lib\-\_\-smem\-\_\-sinit must be called first before this function can be called.
508 \end{DoxyPrecond}
509 Function lib\-\_\-smem\-\_\-mreset resets the slow scratch heap and destroys all allocated memory blocks in it. \hypertarget{group__libarch__memmgt_ga24093174e441c683650863236dcb9806}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-smem\-\_\-valloc@{lib\-\_\-smem\-\_\-valloc}}
510 \index{lib\-\_\-smem\-\_\-valloc@{lib\-\_\-smem\-\_\-valloc}!Memory Management API@{Memory Management A\-P\-I}}
511 \subsubsection[{lib\-\_\-smem\-\_\-valloc}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ lib\-\_\-smem\-\_\-valloc (
512 \begin{DoxyParamCaption}
513 \item[{void $\ast$}]{handle, }
514 \item[{size\-\_\-t}]{size, }
515 \item[{size\-\_\-t}]{align}
516 \end{DoxyParamCaption}
517 )}}\label{group__libarch__memmgt_ga24093174e441c683650863236dcb9806}
520 Function lib\-\_\-smem\-\_\-valloc allocates a memory block from the very fast scratch heap. It will also align the allocated memory block as requested.
523 \begin{DoxyParams}[1]{Parameters}
524 \mbox{\tt in} & {\em handle} & Pointer to the memory descriptor array \\
525 \hline
526 \mbox{\tt in} & {\em size} & Size of memory block to be allocated \\
527 \hline
528 \mbox{\tt in} & {\em align} & Alignment. The address of the allocated memory block will be aligned to 2$^\wedge$align bytes.\\
529 \hline
530 \end{DoxyParams}
532 \begin{DoxyRetVals}{Return values}
533 {\em Non-\/\-N\-U\-L\-L} & Address of the allocated memory block \\
534 \hline
535 {\em N\-U\-L\-L} & Failure to allocate memory\\
536 \hline
537 \end{DoxyRetVals}
538 \begin{DoxyPrecond}{Precondition}
539 Function lib\-\_\-smem\-\_\-vinit must be called first before this function can be used to allocate memory.
540 \end{DoxyPrecond}
541 Function lib\-\_\-smem\-\_\-valloc allocates a memory block from the very fast scratch heap. It will also align the allocated memory block as requested. \hypertarget{group__libarch__memmgt_gaeeb7c8294fcd4640e4eaf7a741397032}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-smem\-\_\-vinit@{lib\-\_\-smem\-\_\-vinit}}
542 \index{lib\-\_\-smem\-\_\-vinit@{lib\-\_\-smem\-\_\-vinit}!Memory Management API@{Memory Management A\-P\-I}}
543 \subsubsection[{lib\-\_\-smem\-\_\-vinit}]{\setlength{\rightskip}{0pt plus 5cm}int lib\-\_\-smem\-\_\-vinit (
544 \begin{DoxyParamCaption}
545 \item[{void $\ast$}]{handle, }
546 \item[{void $\ast$}]{base, }
547 \item[{size\-\_\-t}]{size}
548 \end{DoxyParamCaption}
549 )}}\label{group__libarch__memmgt_gaeeb7c8294fcd4640e4eaf7a741397032}
552 Function lib\-\_\-smem\-\_\-vinit performs necessary initialization for the very fast scratch heap memory allocation.
555 \begin{DoxyParams}[1]{Parameters}
556 \mbox{\tt in} & {\em handle} & Pointer to the memory descriptor array \\
557 \hline
558 \mbox{\tt in} & {\em base} & Base address of the memory to be used as very fast scratch \\
559 \hline
560 \mbox{\tt in} & {\em size} & Size of the memory in bytes\\
561 \hline
562 \end{DoxyParams}
564 \begin{DoxyRetVals}{Return values}
565 {\em L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-S\-U\-C\-C\-E\-S\-S} & Success. No error. \\
566 \hline
567 {\em L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-E\-R\-R\-O\-R} & Failure.\\
568 \hline
569 \end{DoxyRetVals}
570 Function lib\-\_\-smem\-\_\-vinit performs necessary initialization for the very fast scratch heap memory allocation. \hypertarget{group__libarch__memmgt_ga65c30f7a20c6e359df9d73db0c9078c1}{\index{Memory Management A\-P\-I@{Memory Management A\-P\-I}!lib\-\_\-smem\-\_\-vreset@{lib\-\_\-smem\-\_\-vreset}}
571 \index{lib\-\_\-smem\-\_\-vreset@{lib\-\_\-smem\-\_\-vreset}!Memory Management API@{Memory Management A\-P\-I}}
572 \subsubsection[{lib\-\_\-smem\-\_\-vreset}]{\setlength{\rightskip}{0pt plus 5cm}int lib\-\_\-smem\-\_\-vreset (
573 \begin{DoxyParamCaption}
574 \item[{void $\ast$}]{handle}
575 \end{DoxyParamCaption}
576 )}}\label{group__libarch__memmgt_ga65c30f7a20c6e359df9d73db0c9078c1}
579 Function lib\-\_\-smem\-\_\-vreset resets the very fast scratch heap and destroys all allocated memory blocks in it.
582 \begin{DoxyParams}[1]{Parameters}
583 \mbox{\tt in} & {\em handle} & Pointer to the memory descriptor array defined by the library using this funciton\\
584 \hline
585 \end{DoxyParams}
587 \begin{DoxyRetVals}{Return values}
588 {\em L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-S\-U\-C\-C\-E\-S\-S} & Success. No error. \\
589 \hline
590 {\em L\-I\-B\-\_\-\-M\-E\-M\-M\-G\-T\-\_\-\-E\-R\-R\-O\-R} & Failure.\\
591 \hline
592 \end{DoxyRetVals}
593 \begin{DoxyPrecond}{Precondition}
594 Function lib\-\_\-smem\-\_\-vinit must be called first before this function can be called.
595 \end{DoxyPrecond}
596 Function lib\-\_\-smem\-\_\-vreset resets the very fast scratch heap and destroys all allocated memory blocks in it.