Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
gc-managed.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
/*
5 * Authors:
6 * see git history
7 * MenTaLguY <mental@rydia.net>
8 *
9 * Copyright (C) 2018 Authors
10 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
11 */
12
13#ifndef SEEN_INKSCAPE_GC_MANAGED_H
14#define SEEN_INKSCAPE_GC_MANAGED_H
15
16#include "inkgc/gc-core.h"
17
18namespace Inkscape {
19
20namespace GC {
21
25template <ScanPolicy default_scan=SCANNED,
26 CollectionPolicy default_collect=AUTO>
27class Managed {
28public:
29 void *operator new(std::size_t size,
30 ScanPolicy scan=default_scan,
31 CollectionPolicy collect=default_collect)
32 {
33 return ::operator new(size, scan, collect);
34 }
35
36 void *operator new[](std::size_t size,
37 ScanPolicy scan=default_scan,
38 CollectionPolicy collect=default_collect)
39 {
40 return ::operator new[](size, scan, collect);
41 }
42
43 void operator delete(void *p) { return ::operator delete(p, GC); }
44};
45
46}
47
48}
49
50#endif
51/*
52 Local Variables:
53 mode:c++
54 c-file-style:"stroustrup"
55 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
56 indent-tabs-mode:nil
57 fill-column:99
58 End:
59*/
60// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
A base class for objects for whom the normal new and delete operators should use the garbage-collecte...
Definition gc-managed.h:27
Wrapper for Boehm GC.
Helper class to stream background task notifications as a series of messages.