Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::GC Namespace Reference

Boehm-GC based garbage collector. More...

Classes

class  Alloc
 
class  Anchored
 A base class for anchored objects. More...
 
struct  Core
 
class  Managed
 A base class for objects for whom the normal new and delete operators should use the garbage-collected allocator. More...
 
struct  Ops
 

Typedefs

typedef void(* CleanupFunc) (void *mem, void *data)
 

Enumerations

enum  ScanPolicy { SCANNED , ATOMIC }
 
enum  CollectionPolicy { AUTO , MANUAL }
 
enum  Delete { GC }
 

Functions

template<typename R >
static Ranchor (R &r)
 Increments the reference count of a anchored object.
 
template<typename R >
static Ranchor (R *r)
 Increments the reference count of a anchored object.
 
template<typename R >
static Rrelease (R &r)
 Decrements the reference count of a anchored object.
 
template<typename R >
static Rrelease (R *r)
 Decrements the reference count of a anchored object.
 
template<typename T1 , typename T2 , ScanPolicy scan1, ScanPolicy scan2, CollectionPolicy collect1, CollectionPolicy collect2>
bool operator== (Alloc< T1, scan1, collect1 > const &, Alloc< T2, scan2, collect2 > const &)
 
template<typename T1 , typename T2 , ScanPolicy scan1, ScanPolicy scan2, CollectionPolicy collect1, CollectionPolicy collect2>
bool operator!= (Alloc< T1, scan1, collect1 > const &, Alloc< T2, scan2, collect2 > const &)
 
void init ()
 
void request_early_collection ()
 

Detailed Description

Boehm-GC based garbage collector.

This namespace contains code related to the garbage collector and base classes for GC-managed objects.

Typedef Documentation

◆ CleanupFunc

typedef void(* Inkscape::GC::CleanupFunc) (void *mem, void *data)

Definition at line 38 of file gc-core.h.

Enumeration Type Documentation

◆ CollectionPolicy

Enumerator
AUTO 
MANUAL 

Definition at line 29 of file gc-core.h.

◆ Delete

Enumerator
GC 

Definition at line 34 of file gc-core.h.

◆ ScanPolicy

Enumerator
SCANNED 
ATOMIC 

Definition at line 24 of file gc-core.h.

Function Documentation

◆ anchor() [1/2]

◆ anchor() [2/2]

template<typename R >
static R * Inkscape::GC::anchor ( R r)
static

Increments the reference count of a anchored object.

This function template generates functions which take a pointer to a anchored object of a given type, increment that object's reference count, and return a pointer to the object of the same type as the function's parameter.

Parameters
ma pointer to anchored object
Returns
the pointer to the object

Definition at line 110 of file gc-anchored.h.

References Inkscape::GC::Anchored::anchor(), and R.

◆ init()

◆ operator!=()

template<typename T1 , typename T2 , ScanPolicy scan1, ScanPolicy scan2, CollectionPolicy collect1, CollectionPolicy collect2>
bool Inkscape::GC::operator!= ( Alloc< T1, scan1, collect1 > const &  ,
Alloc< T2, scan2, collect2 > const &   
)

Definition at line 57 of file gc-alloc.h.

◆ operator==()

template<typename T1 , typename T2 , ScanPolicy scan1, ScanPolicy scan2, CollectionPolicy collect1, CollectionPolicy collect2>
bool Inkscape::GC::operator== ( Alloc< T1, scan1, collect1 > const &  ,
Alloc< T2, scan2, collect2 > const &   
)

Definition at line 50 of file gc-alloc.h.

◆ release() [1/2]

template<typename R >
static R & Inkscape::GC::release ( R r)
static

Decrements the reference count of a anchored object.

This function template generates functions which take a reference to a anchored object of a given type, decrement that object's reference count, and return a reference to the object of the same type as the function's parameter.

The return value is safe to use since the object, even if its refcount has reached zero, will not actually be collected until there are no references to it in local variables or parameters.

Parameters
ma reference to a anchored object
Returns
the reference to the object

Definition at line 133 of file gc-anchored.h.

References R, and Inkscape::GC::Anchored::release().

Referenced by Inkscape::Extension::Internal::SvgBuilder::_addStopToGradient(), Inkscape::Extension::Internal::SvgBuilder::_addToContainer(), Inkscape::UI::Tools::EraserTool::_booleanErase(), SPGrid::_checkOldGrid(), Inkscape::UI::Tools::EraserTool::_clipErase(), Inkscape::Extension::Internal::SvgBuilder::_createClip(), Inkscape::Extension::Internal::SvgBuilder::_createGradient(), Inkscape::UI::Widget::CanvasGrid::_createGuide(), Inkscape::Extension::Internal::SvgBuilder::_createMask(), Inkscape::Extension::Internal::SvgBuilder::_createTilingPattern(), Inkscape::UI::Toolbar::ArcToolbar::_detachRepr(), Inkscape::UI::Toolbar::Box3DToolbar::_detachRepr(), Inkscape::UI::Toolbar::RectToolbar::_detachRepr(), Inkscape::UI::Toolbar::SpiralToolbar::_detachRepr(), Inkscape::UI::Toolbar::StarToolbar::_detachRepr(), Inkscape::Extension::Internal::SvgBuilder::_flushText(), Inkscape::Extension::Internal::SvgBuilder::_flushTextText(), Inkscape::UI::Tools::ConnectorTool::_flushWhite(), Inkscape::Extension::Internal::SvgBuilder::_getColorProfile(), SPDocument::_importDefsNode(), Inkscape::UI::Tools::EraserTool::_insertAcidIntoDocument(), Inkscape::Preferences::_load(), Inkscape::ObjectSet::_pathBoolOp(), Inkscape::Extension::Internal::SvgBuilder::_pushGroup(), Inkscape::UI::Tools::ConnectorTool::_setActiveShape(), Inkscape::UI::Tools::TextTool::_setupText(), Inkscape::Shortcuts::_write(), active_window_end_helper(), Inkscape::LivePathEffect::LPEPowerClip::add(), Inkscape::UI::Dialog::CPHistoryXML::add_action_parameter(), Inkscape::UI::Dialog::SvgFontsDialog::add_kerning_pair(), Inkscape::UI::Dialog::CPHistoryXML::add_operation(), Inkscape::UI::Widget::GradientSelector::add_vector_clicked(), Inkscape::Extension::Internal::SvgBuilder::addImageMask(), Inkscape::Extension::Internal::SvgBuilder::addMaskedImage(), Inkscape::UI::Tools::PencilTool::addPowerStrokePencil(), Inkscape::Extension::Internal::SvgBuilder::addSoftMaskedImage(), addStop(), Inkscape::UI::Dialog::CloneTiler::apply(), Inkscape::ObjectSet::breakApart(), Inkscape::Extension::build_from_file(), Inkscape::Extension::build_from_mem(), Inkscape::UI::Tools::ConnectorTool::cc_clear_active_conn(), Inkscape::UI::Tools::ConnectorTool::cc_clear_active_shape(), Inkscape::UI::Tools::ConnectorTool::cc_set_active_conn(), Inkscape::Shortcuts::clear_user_shortcuts(), Inkscape::ObjectSet::clone(), Inkscape::ObjectSet::cloneOriginalPathLPE(), Inkscape::ObjectSet::combine(), Inkscape::UI::Dialog::CPHistoryXML::CPHistoryXML(), SPClipPath::create(), SPMask::create(), Inkscape::Extension::Internal::Filter::create_and_apply_filter(), create_flowtext_with_internal_frame(), SPGrid::create_new(), SPFont::create_new_glyph(), create_text_with_inline_size(), create_text_with_rectangle(), Persp3D::create_xml_element(), Inkscape::LivePathEffect::Effect::createAndApply(), Inkscape::Extension::Implementation::Script::PreviewObserver::createAndSendEvent(), Inkscape::LivePathEffect::LPEMeasureSegments::createArrowMarker(), Inkscape::ObjectSet::createBitmapCopy(), SPDocument::createDoc(), Inkscape::LivePathEffect::LPEMeasureSegments::createLine(), SPDocument::createNewDocFromMem(), SPGuide::createSPGuide(), Inkscape::LivePathEffect::LPEMeasureSegments::createTextLabel(), Inkscape::LivePathEffect::LPEBool::divisionit(), Inkscape::UI::Tools::do_trace(), Inkscape::LivePathEffect::LPEBool::doBeforeEffect(), Inkscape::LivePathEffect::LPEMeasureSegments::doOnApply(), Inkscape::UI::Tools::SpiralTool::drag(), Inkscape::UI::Tools::ArcTool::drag(), Inkscape::UI::Tools::RectTool::drag(), Inkscape::UI::Tools::StarTool::drag(), Inkscape::ObjectSet::duplicate(), Inkscape::XML::SimpleDocument::duplicate(), Inkscape::Extension::Internal::BlurEdge::effect(), Inkscape::Extension::Internal::Filter::Filter::effect(), Inkscape::Extension::Internal::Grid::effect(), Inkscape::Extension::Internal::Grid::effect(), file_import(), file_import_pages(), filter_add_primitive(), Inkscape::Extension::Internal::Filter::filters_load_file(), flowtext_to_text(), LivePathEffectObject::fork_private_if_necessary(), Inkscape::LivePathEffect::LPEBool::fractureit(), generate_linked_fill(), generate_marker(), Inkscape::Shortcuts::get_file_names(), Inkscape::UI::Dialog::get_first_style_text_node(), SPFlowtext::getAsText(), SPDocument::getNamedView(), Inkscape::ObjectSet::group(), insert_text_fallback(), item_to_paths(), Inkscape::loadImpl(), Inkscape::Extension::Internal::Filter::merge_filters(), modify_filter_gaussian_blur_from_item(), move_child_nodes(), Inkscape::UI::Tools::MeshTool::new_default(), new_filter(), new_filter_blend_gaussian_blur(), new_filter_gaussian_blur(), Inkscape::UI::Dialog::new_font(), Inkscape::PageManager::newPage(), Inkscape::UI::Dialog::FilterEffectsDialog::PrimitiveList::on_click_released(), Inkscape::Extension::Internal::GdkpixbufInput::open(), Inkscape::Extension::Internal::Svg::open(), Inkscape::Colors::paint_to_xml(), Inkscape::Colors::paint_to_xml_string(), Inkscape::UI::Toolbar::TextToolbar::prepare_inner(), SPPattern::produce(), Inkscape::Extension::Internal::SvgBuilder::pushPage(), SPStyle::readFromPrefs(), SPDocument::rebase(), recursively_apply_style(), InkscapeApplication::redirect_output(), redundant_double_nesting_processor(), redundant_semi_nesting_processor(), SPObject::releaseReferences(), SPGradient::repr_write_vector(), Inkscape::Preferences::reset(), Inkscape::Extension::Implementation::Script::PreviewObserver::selectionChanged(), Inkscape::UI::Tools::CalligraphicTool::set_to_accumulated(), Inkscape::ObjectSet::setClipGroup(), Inkscape::UI::Toolbar::ConnectorToolbar::setDesktop(), Inkscape::UI::Tools::MeasureTool::setGuide(), Inkscape::UI::Tools::MeasureTool::setLabelText(), Inkscape::UI::Tools::MeasureTool::setMarker(), Inkscape::LivePathEffect::LPEPowerMask::setMask(), Inkscape::ObjectSet::setMask(), Inkscape::UI::Tools::MeasureTool::setMeasureItem(), Inkscape::UI::Dialog::AttrDialog::setRepr(), SPObject::setTitleOrDesc(), show_output(), sp_copy_resource(), sp_document_default_gradient_vector(), sp_file_save_template(), sp_gradient_add_stop(), sp_gradient_fork_private_if_necessary(), sp_gradient_fork_vector_if_necessary(), sp_gradient_get_private_normalized(), sp_gradient_load_from_svg(), sp_gradient_reverse_vector(), sp_import_document(), sp_item_group_ungroup(), sp_item_list_to_curves(), sp_lpe_item_cleanup_original_path_recursive(), sp_marker_fork_if_necessary(), sp_marker_load_from_svg(), sp_repr_css_attr_unref(), sp_repr_do_read(), sp_repr_document_new(), sp_repr_svg_read_node(), sp_selected_item_to_curved_repr(), sp_selected_path_create_offset_object(), sp_selected_path_do_offset(), sp_selection_paste_impl(), Inkscape::UI::Tools::sp_spray_recursive(), sp_te_insert(), sp_te_insert_line(), sp_te_set_repr_text_multiline(), sp_tref_convert_to_tspan(), sp_tref_update_text(), Inkscape::UI::Tools::sp_tweak_dilate_recursive(), sp_vector_add_stop(), Inkscape::UI::Tools::spdc_create_single_dot(), Inkscape::UI::Tools::spdc_flush_white(), Inkscape::LivePathEffect::LPESlice::split(), split_text_object_tree_at(), Inkscape::SelTrans::stamp(), text_flow_into_shape(), text_put_on_path(), text_to_glyphs(), text_unflow(), tidy_operator_inexplicable_spans(), Inkscape::ObjectSet::tile(), Inkscape::UI::Tools::MeasureTool::toItem(), Inkscape::LivePathEffect::LPECopyRotate::toItem(), Inkscape::LivePathEffect::LPETiling::toItem(), Inkscape::LivePathEffect::LPEMirrorSymmetry::toMirror(), Inkscape::ObjectSet::toSymbol(), Inkscape::LivePathEffect::LPEPowerMask::tryForkMask(), Inkscape::UI::Toolbar::TextToolbar::unindent_node(), SPUse::unlink(), Inkscape::UI::ShapeEditor::unset_item(), SPSymbol::unSymbol(), Inkscape::UI::Widget::FillNStroke::updateFromPaint(), verify_grad(), SPFilter::write(), SPFlowtext::write(), SPText::write(), SPTextPath::write(), SPTSpan::write(), SPDefs::write(), SPFlowdiv::write(), SPFlowtspan::write(), SPFlowpara::write(), SPFlowregion::write(), SPFlowregionExclude::write(), SPGradient::write(), SPGroup::write(), SPItem::write(), SPObjectGroup::write(), Inkscape::Colors::xml_string_to_paint(), Inkscape::UI::Dialog::CPHistoryXML::~CPHistoryXML(), Inkscape::Extension::Dependency::~Dependency(), Inkscape::Extension::Effect::~Effect(), Inkscape::Extension::Extension::~Extension(), Inkscape::Preferences::~Preferences(), and SPDocument::~SPDocument().

◆ release() [2/2]

template<typename R >
static R * Inkscape::GC::release ( R r)
static

Decrements the reference count of a anchored object.

This function template generates functions which take a pointer to a anchored object of a given type, decrement that object's reference count, and return a pointer to the object of the same type as the function's parameter.

The return value is safe to use since the object, even if its refcount has reached zero, will not actually be collected until there are no references to it in local variables or parameters.

Parameters
ma pointer to a anchored object
Returns
the pointer to the object

Definition at line 156 of file gc-anchored.h.

References R, and Inkscape::GC::Anchored::release().

◆ request_early_collection()

void Inkscape::GC::request_early_collection ( )

Definition at line 294 of file gc.cpp.