[cig-commits] r6089 - in long/3D/Gale/trunk/src/StGermain: . Discretisation/Mesh/src

walter at geodynamics.org walter at geodynamics.org
Fri Feb 23 10:02:36 PST 2007


Author: walter
Date: 2007-02-23 10:02:35 -0800 (Fri, 23 Feb 2007)
New Revision: 6089

Modified:
   long/3D/Gale/trunk/src/StGermain/
   long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/Decomp_Sync.c
Log:
 r3340 at earth (orig r4012):  LukeHodkinson | 2007-02-19 20:05:17 -0800
 Converting the Sync class to use reference counting
 for the communication topology. A while back I changed
 things so that a communication topology could be used 
 for multiple syncs, so refernce couting is a must.
 



Property changes on: long/3D/Gale/trunk/src/StGermain
___________________________________________________________________
Name: svk:merge
   - 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:3196
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/branches/decomp3d/StGermain:4010
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3899
   + 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:3196
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/branches/decomp3d/StGermain:4012
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3899

Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/Decomp_Sync.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/Decomp_Sync.c	2007-02-23 18:02:29 UTC (rev 6088)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/Decomp_Sync.c	2007-02-23 18:02:35 UTC (rev 6089)
@@ -72,6 +72,7 @@
 void _Decomp_Sync_Init( Decomp_Sync* self ) {
 	self->decomp = NULL;
 	self->commTopo = CommTopology_New();
+	Stg_Class_AddRef( self->commTopo );
 
 	self->nDomains = 0;
 	self->nRemotes = 0;
@@ -149,10 +150,13 @@
 	assert( self );
 
 	Decomp_Sync_DestructComm( self );
-	if( commTopo )
+	if( commTopo ) {
 		self->commTopo = commTopo;
+		Stg_Class_AddRef( commTopo );
+	}
 	else {
 		self->commTopo = CommTopology_New();
+		Stg_Class_AddRef( commTopo );
 		if( self->decomp )
 			CommTopology_SetComm( self->commTopo, Decomp_GetComm( self->decomp ) );
 	}
@@ -1009,7 +1013,8 @@
 	assert( self );
 
 	Decomp_Sync_DestructRemotes( self );
-	KillObject( self->commTopo );
+	Stg_Class_RemoveRef( self->commTopo );
+	self->commTopo = NULL;
 	KillArray( self->nSrcs );
 	KillArray( self->srcs );
 	KillArray( self->nSnks );



More information about the cig-commits mailing list