~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to libbase/GC.cpp

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2012-03-04 03:19:06 UTC
  • mfrom: (1.1.18) (3.1.24 sid)
  • Revision ID: package-import@ubuntu.com-20120304031906-p6q5rnb0xhgpof7o
Tags: 0.8.10-3ubuntu1
* Merge from Debian testing (FFe: LP: #940876), remaining changes:
  - Use mozilla-flashplugin as the alternative for now
  - Change xulrunner-dev build dep to firefox-dev
* Drop the plugin API porting patch, this has been fixed upstream
  - drop debian/patches*
* Drop the following change as we want Adobe's player to take priority
  if it's installed
  - Set alternative priority to 50 so that it matches Adobe Flash's priority

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// GC.cpp: Garbage Collector, for Gnash
2
2
// 
3
 
//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010,
4
 
//   2011 Free Software Foundation, Inc
 
3
//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
 
4
//   Free Software Foundation, Inc
5
5
// 
6
6
// This program is free software; you can redistribute it and/or modify
7
7
// it under the terms of the GNU General Public License as published by
43
43
#endif
44
44
{
45
45
#ifdef GNASH_GC_DEBUG 
46
 
    log_debug(_("GC %p created"), (void*)this);
 
46
    log_debug("GC %p created", (void*)this);
47
47
#endif
48
48
    char* gcgap = std::getenv("GNASH_GC_TRIGGER_THRESHOLD");
49
49
    if (gcgap) {
55
55
GC::~GC()
56
56
{
57
57
#ifdef GNASH_GC_DEBUG 
58
 
    log_debug(_("GC deleted, deleting all managed resources - collector run %d times"), _collectorRuns);
 
58
    log_debug("GC deleted, deleting all managed resources - collector run %d times", _collectorRuns);
59
59
#endif
60
60
    for (ResList::const_iterator i = _resList.begin(), e = _resList.end();
61
61
            i != e; ++i) {
68
68
{
69
69
 
70
70
#if (GNASH_GC_DEBUG > 1)
71
 
    log_debug(_("GC: sweep scan started"));
 
71
    log_debug("GC: sweep scan started");
72
72
#endif
73
73
 
74
74
    size_t deleted = 0;
78
78
        if (!res->isReachable()) {
79
79
 
80
80
#if GNASH_GC_DEBUG > 1
81
 
            log_debug(_("GC: recycling object %p (%s)"), res, typeName(*res));
 
81
            log_debug("GC: recycling object %p (%s)", res, typeName(*res));
82
82
#endif
83
83
            ++deleted;
84
84
            delete res;
93
93
    _resListSize -= deleted;
94
94
 
95
95
#ifdef GNASH_GC_DEBUG 
96
 
    log_debug(_("GC: recycled %d unreachable resources - %d left"),
 
96
    log_debug("GC: recycled %d unreachable resources - %d left",
97
97
            deleted, _resListSize);
98
98
#endif
99
99
 
112
112
#endif
113
113
 
114
114
#ifdef GNASH_GC_DEBUG 
115
 
    log_debug(_("GC: collection cycle started - %d/%d new resources "
116
 
            "allocated since last run (from %d to %d)"),
 
115
    log_debug("GC: collection cycle started - %d/%d new resources "
 
116
            "allocated since last run (from %d to %d)",
117
117
            _resListSize - _lastResCount, _maxNewCollectablesCount,
118
118
            _lastResCount, _resListSize);
119
119
#endif // GNASH_GC_DEBUG