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

walter at geodynamics.org walter at geodynamics.org
Fri Jan 5 11:35:13 PST 2007


Author: walter
Date: 2007-01-05 11:35:12 -0800 (Fri, 05 Jan 2007)
New Revision: 5659

Modified:
   long/3D/Gale/trunk/src/StGermain/
   long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/ElementCellLayout.c
Log:
 r3230 at earth (orig r3921):  LukeHodkinson | 2007-01-01 17:41:11 -0800
 Fixing some invalid memory accesses.
 



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:3920
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3899
   + 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:3196
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/branches/decomp3d/StGermain:3921
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3899

Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/ElementCellLayout.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/ElementCellLayout.c	2007-01-05 19:35:10 UTC (rev 5658)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/ElementCellLayout.c	2007-01-05 19:35:12 UTC (rev 5659)
@@ -406,12 +406,12 @@
 	/* Extract neighbouring proc information. */
 	self->cellShadowInfo.procNbrInfo = Memory_Alloc_Unnamed( ProcNbrInfo );
 	self->cellShadowInfo.procNbrInfo->procNbrCnt = nIncProcs;
-	self->cellShadowInfo.procNbrInfo->procNbrTbl = Memory_Alloc_Array_Unnamed( unsigned, nIncProcs );
+	self->cellShadowInfo.procNbrInfo->procNbrTbl = AllocArray( unsigned, nIncProcs );
 	memcpy( self->cellShadowInfo.procNbrInfo->procNbrTbl, incProcs, nIncProcs * sizeof(unsigned) );
 
 	/* Count shadow info. */
-	self->cellShadowInfo.procShadowedCnt = Memory_Alloc_Array_Unnamed( unsigned, nIncProcs );
-	self->cellShadowInfo.procShadowCnt = Memory_Alloc_Array_Unnamed( unsigned, nIncProcs );
+	self->cellShadowInfo.procShadowedCnt = AllocArray( unsigned, nIncProcs );
+	self->cellShadowInfo.procShadowCnt = AllocArray( unsigned, nIncProcs );
 	for( n_i = 0; n_i < Mesh_GetSharedSize( self->mesh, nDims ); n_i++ ) {
 		unsigned	nSharers;
 		unsigned*	sharers;
@@ -430,10 +430,14 @@
 	}
 
 	/* Build shadow info indices. */
-	self->cellShadowInfo.procShadowedTbl = Memory_Alloc_2DComplex_Unnamed( unsigned, nIncProcs, self->cellShadowInfo.procShadowedCnt );
-	self->cellShadowInfo.procShadowTbl = Memory_Alloc_2DComplex_Unnamed( unsigned, nIncProcs, self->cellShadowInfo.procShadowCnt );
-	memset( self->cellShadowInfo.procShadowedCnt, 0, nIncProcs * sizeof(unsigned) );
-	memset( self->cellShadowInfo.procShadowCnt, 0, nIncProcs * sizeof(unsigned) );
+	if( nIncProcs ) {
+		self->cellShadowInfo.procShadowedTbl = Memory_Alloc_2DComplex_Unnamed( unsigned, nIncProcs, 
+										       self->cellShadowInfo.procShadowedCnt );
+		self->cellShadowInfo.procShadowTbl = Memory_Alloc_2DComplex_Unnamed( unsigned, nIncProcs, 
+										     self->cellShadowInfo.procShadowCnt );
+		memset( self->cellShadowInfo.procShadowedCnt, 0, nIncProcs * sizeof(unsigned) );
+		memset( self->cellShadowInfo.procShadowCnt, 0, nIncProcs * sizeof(unsigned) );
+	}
 	for( n_i = 0; n_i < Mesh_GetSharedSize( self->mesh, nDims ); n_i++ ) {
 		unsigned	local;
 		unsigned	curInd;



More information about the cig-commits mailing list