KJS::Collector

#include <collector.h>

Static Public Member Functions

static void * allocate (size_t s)
 
static bool collect ()
 
static bool isCellMarked (const JSCell *)
 
static bool isOutOfMemory ()
 
static void markCell (JSCell *)
 
static size_t numInterpreters ()
 
static size_t numProtectedObjects ()
 
static void protect (JSValue *)
 
static void registerThread ()
 
static void reportExtraMemoryCost (size_t cost)
 
static HashCountedSet< const char * > * rootObjectTypeCounts ()
 
static size_t size ()
 
static void unprotect (JSValue *)
 

Static Public Attributes

static const size_t minExtraCostSize = 256
 

Detailed Description

Garbage collector.

Definition at line 42 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
sSize of the memory to be registered.
Returns
A pointer to the allocated memory.

Definition at line 331 of file collector.cpp.

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 673 of file collector.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Nov 28 2020 23:00:23 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.