\section{KJS::Collector Class Reference}
\label{classKJS_1_1Collector}\index{KJS::Collector@{KJS::Collector}}
Garbage collector.  


{\tt \#include $<$collector.h$>$}

\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
void $\ast$ {\bf allocate} (size\_\-t s)
\begin{CompactList}\small\item\em Register an object with the collector. \item\end{CompactList}\item 
bool {\bf collect} ()
\begin{CompactList}\small\item\em Run the garbage collection. \item\end{CompactList}\item 
int {\bf size} ()\label{classKJS_1_1Collector_e2}

\item 
bool {\bf out\-Of\-Memory} ()\label{classKJS_1_1Collector_e3}

\end{CompactItemize}


\subsection{Detailed Description}
Garbage collector. 



Definition at line 59 of file collector.h.

\subsection{Member Function Documentation}
\index{KJS::Collector@{KJS::Collector}!allocate@{allocate}}
\index{allocate@{allocate}!KJS::Collector@{KJS::Collector}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void $\ast$ Collector::allocate (size\_\-t {\em s})\hspace{0.3cm}{\tt  [static]}}\label{classKJS_1_1Collector_e0}


Register an object with the collector. 

The following assumptions are made: \begin{itemize}
\item the operator new() of the object class is overloaded. \item operator delete() has been overloaded as well and does not free the memory on its own.\end{itemize}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s}]Size of the memory to be registered. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A pointer to the allocated memory. \end{Desc}


Definition at line 75 of file collector.cpp.

References collect().\index{KJS::Collector@{KJS::Collector}!collect@{collect}}
\index{collect@{collect}!KJS::Collector@{KJS::Collector}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Collector::collect ()\hspace{0.3cm}{\tt  [static]}}\label{classKJS_1_1Collector_e1}


Run the garbage collection. 

This involves calling the delete operator on each object and freeing the used memory. 

Definition at line 140 of file collector.cpp.

References KJS::Value\-Imp::\_\-flags, KJS::Value\-Imp::mark(), KStd\-Accel::next(), KJS::Value\-Imp::refcount, and KJS::Value\-Imp::$\sim$Value\-Imp().

Referenced by allocate().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
collector.h\item 
collector.cpp\end{CompactItemize}
