diff --git a/src/gc.cpp b/src/gc.cpp
index 7333b4641bd0b3e2bedda6d0a8664c8d9a1dfeaf..97350daffa4686080b112df5049363964a888ba8 100644 (file)
--- a/src/gc.cpp
+++ b/src/gc.cpp
-/*
- * Inkscape::GC - Wrapper for Boehm GC
- *
- * Authors:
+/** @file
+ * @brief Wrapper for Boehm GC
+ */
+/* Authors:
* MenTaLguY <mental@rydia.net>
*
* Copyright (C) 2004 MenTaLguY
#include "gc-core.h"
#include <stdexcept>
+#include <cstring>
+#include <string>
#include <glib/gmessages.h>
+#include <sigc++/functors/ptr_fun.h>
+#include <glibmm/main.h>
namespace Inkscape {
namespace GC {
int dummy_general_register_disappearing_link(void **, void *) { return false; }
-int dummy_unregister_disappearing_link(void **link) { return false; }
+int dummy_unregister_disappearing_link(void **/*link*/) { return false; }
std::size_t dummy_get_heap_size() { return 0; }
_ops.do_init();
}
+
+namespace {
+
+bool collection_requested=false;
+bool collection_task() {
+ Core::gcollect();
+ Core::gcollect();
+ collection_requested=false;
+ return false;
+}
+
+}
+
+void request_early_collection() {
+ if (!collection_requested) {
+ collection_requested=true;
+ Glib::signal_idle().connect(sigc::ptr_fun(&collection_task));
+ }
+}
+
}
}
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :