[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog libbase/GC.cpp libbase/GC.h
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog libbase/GC.cpp libbase/GC.h |
Date: |
Wed, 20 Jun 2007 14:27:30 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/06/20 14:27:30
Modified files:
. : ChangeLog
libbase : GC.cpp GC.h
Log message:
* server/fill_style.{cpp,h}: add an markReachableResources()
function to keep alive eventual bitmap and character fills.
* server/parser/shape_character_def.{cpp,h}: implement resource
marking function, marking fill styles.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3588&r2=1.3589
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/GC.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/GC.h?cvsroot=gnash&r1=1.8&r2=1.9
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3588
retrieving revision 1.3589
diff -u -b -r1.3588 -r1.3589
--- ChangeLog 20 Jun 2007 14:23:49 -0000 1.3588
+++ ChangeLog 20 Jun 2007 14:27:29 -0000 1.3589
@@ -1,5 +1,7 @@
2007-06-20 Sandro Santilli <address@hidden>
+ * libbase/GC.{cpp,h}: moved destructor and cleanUnreachable methods
+ from header to implementation file.
* server/fill_style.{cpp,h}: add an markReachableResources()
function to keep alive eventual bitmap and character fills.
* server/parser/shape_character_def.{cpp,h}: implement resource
Index: libbase/GC.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/GC.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- libbase/GC.cpp 15 Jun 2007 18:16:32 -0000 1.1
+++ libbase/GC.cpp 20 Jun 2007 14:27:30 -0000 1.2
@@ -16,13 +16,14 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: GC.cpp,v 1.1 2007/06/15 18:16:32 strk Exp $ */
+/* $Id: GC.cpp,v 1.2 2007/06/20 14:27:30 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "GC.h"
+#include "builtin_function.h"
namespace gnash {
@@ -52,6 +53,55 @@
_singleton = NULL;
}
+GC::~GC()
+{
+#ifdef GNASH_GC_DEBUG
+ log_debug(_("GC %p deleted, deleting all managed resources"),
(void*)this);
+#endif
+
+#if 1
+ for (ResList::iterator i=_resList.begin(), e=_resList.end(); i!=e; ++i)
+ {
+ delete *i;
+ }
+#endif
+}
+
+void
+GC::cleanUnreachable()
+{
+#ifdef GNASH_GC_DEBUG
+ size_t deleted = 0;
+ log_debug(_("GC %p: SWEEP SCAN"), (void*)this);
+#endif
+ for (ResList::iterator i=_resList.begin(), e=_resList.end(); i!=e; )
+ {
+ const GcResource* res = *i;
+ if ( ! res->isReachable() )
+ {
+#ifdef GNASH_GC_DEBUG
+#if GNASH_GC_DEBUG > 1
+ log_debug(_("GC %p: cleanUnreachable deleting object %p
(%s)"),
+ (void*)this, (void*)res,
typeid(*res).name());
+#endif
+ ++deleted;
+#endif
+ delete res;
+ i = _resList.erase(i);
+ }
+ else
+ {
+ res->clearReachable();
+ ++i;
+ }
+ }
+#ifdef GNASH_GC_DEBUG
+ log_debug(_("GC %p: cleanUnreachable deleted " SIZET_FMT
+ " resources marked as unreachable"),
+ (void*)this, deleted);
+#endif
+}
+
} // end of namespace gnash
Index: libbase/GC.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/GC.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- libbase/GC.h 18 Jun 2007 08:13:10 -0000 1.8
+++ libbase/GC.h 20 Jun 2007 14:27:30 -0000 1.9
@@ -253,27 +253,11 @@
}
/// Destroy the collector, releasing all collectables.
- ~GC()
- {
-#ifdef GNASH_GC_DEBUG
- log_debug(_("GC %p deleted, NOT collecting again all managed
resources"), (void*)this);
-#endif
-
-#if 0
- for (ResList::iterator i=_resList.begin(), e=_resList.end();
i!=e; ++i)
- {
- delete *i;
- }
-#endif
- }
-
+ ~GC();
/// List of collectables
typedef std::list<const GcResource *> ResList;
- /// List of roots
- typedef std::list<const GcRoot *> RootList;
-
/// Mark all reachable resources
void markReachable()
{
@@ -284,39 +268,7 @@
}
/// Delete all unreachable objects, and mark the others unreachable
again
- void cleanUnreachable()
- {
-#ifdef GNASH_GC_DEBUG
- size_t deleted = 0;
- log_debug(_("GC %p: SWEEP SCAN"), (void*)this);
-#endif
- for (ResList::iterator i=_resList.begin(), e=_resList.end();
i!=e; )
- {
- const GcResource* res = *i;
- if ( ! res->isReachable() )
- {
-#ifdef GNASH_GC_DEBUG
-#if GNASH_GC_DEBUG > 1
- log_debug(_("GC %p: cleanUnreachable deleting
object %p (%s)"),
- (void*)this, (void*)res,
typeid(*res).name());
-#endif
- ++deleted;
-#endif
- delete res;
- i = _resList.erase(i);
- }
- else
- {
- res->clearReachable();
- ++i;
- }
- }
-#ifdef GNASH_GC_DEBUG
- log_debug(_("GC %p: cleanUnreachable deleted " SIZET_FMT
- " resources marked as unreachable"),
- (void*)this, deleted);
-#endif
- }
+ void cleanUnreachable();
ResList _resList;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog libbase/GC.cpp libbase/GC.h,
Sandro Santilli <=