\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 
static void $\ast$ {\bf allocate} (size\_\-t s)
\item 
static bool {\bf collect} ()
\item 
static int {\bf size} ()\label{classKJS_1_1Collector_e2}

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

\end{CompactItemize}


\subsection{Detailed Description}
Garbage collector. 



Definition at line 38 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$ KJS::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 82 of file collector.cpp.

References KJS::Value\-Imp::\_\-vd, and collect().\index{KJS::Collector@{KJS::Collector}!collect@{collect}}
\index{collect@{collect}!KJS::Collector@{KJS::Collector}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KJS::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 157 of file collector.cpp.

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

Referenced by allocate(), and KJS::Interpreter::collect().

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