~ubuntu-branches/ubuntu/oneiric/inkscape/oneiric-updates

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/debug/heap.h

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Inkscape::Debug::Heap - interface for gathering heap statistics
 
3
 *
 
4
 * Authors:
 
5
 *   MenTaLguY <mental@rydia.net>
 
6
 *
 
7
 * Copyright (C) 2005 MenTaLguY
 
8
 *
 
9
 * Released under GNU GPL, read the file 'COPYING' for more information
 
10
 */
 
11
 
 
12
#ifndef SEEN_INKSCAPE_DEBUG_HEAP_H
 
13
#define SEEN_INKSCAPE_DEBUG_HEAP_H
 
14
 
 
15
#include <cstddef>
 
16
#include "util/share.h"
 
17
 
 
18
namespace Inkscape {
 
19
 
 
20
namespace Debug {
 
21
 
 
22
class Heap {
 
23
public:
 
24
    virtual ~Heap() {}
 
25
 
 
26
    struct Stats {
 
27
        std::size_t size;
 
28
        std::size_t bytes_used;
 
29
    };
 
30
 
 
31
    enum {
 
32
        SIZE_AVAILABLE    = ( 1 << 0 ),
 
33
        USED_AVAILABLE    = ( 1 << 1 ),
 
34
        GARBAGE_COLLECTED = ( 1 << 2 )
 
35
    };
 
36
 
 
37
    virtual int features() const=0;
 
38
 
 
39
    virtual Util::ptr_shared<char> name() const=0;
 
40
    virtual Stats stats() const=0;
 
41
    virtual void force_collect()=0;
 
42
};
 
43
 
 
44
unsigned heap_count();
 
45
Heap *get_heap(unsigned i);
 
46
 
 
47
void register_extra_heap(Heap &heap);
 
48
 
 
49
}
 
50
 
 
51
}
 
52
 
 
53
#endif
 
54
/*
 
55
  Local Variables:
 
56
  mode:c++
 
57
  c-file-style:"stroustrup"
 
58
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
59
  indent-tabs-mode:nil
 
60
  fill-column:99
 
61
  End:
 
62
*/
 
63
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :