/** @file
* Wrapper for Boehm GC.
*/
/* Authors:
* MenTaLguY <mental@rydia.net>
*
* Copyright (C) 2004 MenTaLguY
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <stdexcept>
#include <cstring>
#include <string>
#include <glib.h>
#include <cstddef>
namespace Inkscape {
namespace GC {
namespace {
}
void do_init() {
GC_set_no_dls(1);
GC_INIT();
}
}
}
}
}
}
return fixup;
}
return base + debug_base_fixup();
}
#else // compatibility with older Boehm GC versions
#endif
}
void dummy_do_init() {}
{
if (old_func) {
}
if (old_data) {
}
}
int dummy_general_register_disappearing_link(void **, void const *) { return false; }
void dummy_gcollect() {}
void dummy_enable() {}
void dummy_disable() {}
&do_init,
&GC_base,
#else // compatibility with older Boehm GC versions
(int (*)(void**, const void*))(&GC_general_register_disappearing_link),
#endif
};
&do_init,
};
};
public:
{}
};
if (mode_string) {
return enabled_ops;
return debug_ops;
return disabled_ops;
} else {
throw InvalidGCModeError(mode_string);
}
} else {
return enabled_ops;
}
}
void die_because_not_initialized() {
g_error("Attempt to use GC allocator before call to Inkscape::GC::init()");
}
return NULL;
}
void *stub_base(void *) {
return NULL;
}
CleanupFunc *, void **)
{
}
int stub_general_register_disappearing_link(void **, void const *) {
return 0;
}
int stub_unregister_disappearing_link(void **) {
return 0;
}
return 0;
}
return 0;
}
void stub_gcollect() {
}
void stub_enable() {
}
void stub_disable() {
}
void stub_free(void *) {
}
}
NULL,
};
try {
} catch (InvalidGCModeError &e) {
_ops = enabled_ops;
}
}
namespace {
bool collection_requested=false;
bool collection_task() {
collection_requested=false;
return false;
}
}
void request_early_collection() {
if (!collection_requested) {
collection_requested=true;
}
}
}
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :