gc.cpp revision 6b15695578f07a3f72c4c9475c1a261a3021472a
/*
* Inkscape::GC - 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 "gc-core.h"
#include <stdexcept>
#include <glib/gmessages.h>
namespace Inkscape {
namespace GC {
namespace {
}
void do_init() {
GC_no_dls = 1;
GC_INIT();
}
}
}
}
}
}
return fixup;
}
void *debug_base(void *ptr) {
return base + debug_base_fixup();
}
}
void dummy_do_init() {}
void *dummy_base(void *) { return NULL; }
void dummy_register_finalizer(void *, CleanupFunc, void *,
{
if (old_func) {
}
if (old_data) {
}
}
int dummy_general_register_disappearing_link(void **, void *) { return false; }
int dummy_unregister_disappearing_link(void **link) { return false; }
void dummy_gcollect() {}
void dummy_enable() {}
void dummy_disable() {}
Ops enabled_ops = {
&do_init,
&GC_base,
};
&do_init,
};
Ops disabled_ops = {
};
public:
InvalidGCModeError(const char *mode)
{}
};
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;
}
void stub_register_finalizer_ignore_self(void *, CleanupFunc, void *,
CleanupFunc *, void **)
{
}
int stub_general_register_disappearing_link(void **, void *) {
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;
}
}
}
}
/*
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:encoding=utf-8:textwidth=99 :