kjs Library API Documentation

KJS::Collector Class Reference

Garbage collector. More...

#include <collector.h>

List of all members.

Static Public Member Functions

void * allocate (size_t s)
bool collect ()
int size ()
bool outOfMemory ()


Detailed Description

Garbage collector.

Definition at line 38 of file collector.h.


Member Function Documentation

void * KJS::Collector::allocate size_t  s  )  [static]
 

Register an object with the collector.

The following assumptions are made:

  • the operator new() of the object class is overloaded.
  • operator delete() has been overloaded as well and does not free the memory on its own.
Parameters:
s Size of the memory to be registered.
Returns:
A pointer to the allocated memory.

Definition at line 82 of file collector.cpp.

References KJS::ValueImp::_vd, and collect().

bool KJS::Collector::collect  )  [static]
 

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::ValueImp::_flags, KJS::ValueImp::_vd, KJS::ValueImp::mark(), KJS::ValueImp::refcount, and KJS::ValueImp::~ValueImp().

Referenced by allocate().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kjs Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed May 12 09:05:46 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2003