source: doc/theses/mubeen_zulfiqar_MMath/dofree.tex @ a6e8f64

ADTast-experimentalpthread-emulationqualifiedEnum
Last change on this file since a6e8f64 was ba897d21, checked in by m3zulfiq <m3zulfiq@…>, 3 years ago

added benchmark and evaluations chapter to thesis

  • Property mode set to 100644
File size: 1.2 KB
Line 
1Algorithm~\ref{alg:heapObjectFreeOwn} shows how a free request is fulfilled if object ownership is turned on. Algorithm~\ref{alg:heapObjectFreeNoOwn} shows how the same free request is fulfilled without object ownership.
2
3\begin{algorithm}
4\caption{Dynamic object free at address A with object ownership}\label{alg:heapObjectFreeOwn}
5\begin{algorithmic}[1]
6\If {$\textit{A was mmap-ed}$}
7        \State $\text{return A's dynamic memory to system using system call munmap}$
8\Else
9        \State $\text{B} \gets \textit{O's owner}$
10        \If {$\textit{B is thread-local heap's bucket}$}
11                \State $\text{push A to B's free-list}$
12        \Else
13                \State $\text{push A to B's away-list}$
14        \EndIf
15\EndIf
16\end{algorithmic}
17\end{algorithm}
18
19\begin{algorithm}
20\caption{Dynamic object free at address A without object ownership}\label{alg:heapObjectFreeNoOwn}
21\begin{algorithmic}[1]
22\If {$\textit{A was mmap-ed}$}
23        \State $\text{return A's dynamic memory to system using system call munmap}$
24\Else
25        \State $\text{B} \gets \textit{O's owner}$
26        \If {$\textit{B is thread-local heap's bucket}$}
27                \State $\text{push A to B's free-list}$
28        \Else
29                \State $\text{C} \gets \textit{thread local heap's bucket with same size as B}$
30                \State $\text{push A to C's free-list}$
31        \EndIf
32\EndIf
33\end{algorithmic}
34\end{algorithm}
Note: See TracBrowser for help on using the repository browser.