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

walter at geodynamics.org walter at geodynamics.org
Wed Oct 11 13:45:47 PDT 2006


Author: walter
Date: 2006-10-11 13:45:47 -0700 (Wed, 11 Oct 2006)
New Revision: 4814

Modified:
   long/3D/Gale/trunk/src/StGermain/
   long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshClass.c
Log:
 r2871 at earth:  boo | 2006-10-11 13:42:26 -0700
  r2787 at earth (orig r3775):  KathleenHumble | 2006-08-31 00:41:04 -0700
  changing all malloc, realloc, free and strdup into StGermain eqivalents.
  
 



Property changes on: long/3D/Gale/trunk/src/StGermain
___________________________________________________________________
Name: svk:merge
   - 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:2870
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3774
   + 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:2871
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3775

Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshClass.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshClass.c	2006-10-11 20:45:44 UTC (rev 4813)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshClass.c	2006-10-11 20:45:47 UTC (rev 4814)
@@ -2046,11 +2046,11 @@
 		// TODO: see if some of this can be reduced into re-usable funcs
 
 		/* allocate some work space */
-		request = (MPI_Request*)malloc( sizeof(MPI_Request) * self->procNbrInfo->procNbrCnt );
+		request = Memory_Alloc_Array( MPI_Request , self->procNbrInfo->procNbrCnt, "MPI_Request_procNbrCnt" );
 		assert( request );
 		
 		/* convert my shadow element indices to global element indices */
-		elementTbl = (Element_ShadowIndex*)malloc( sizeof(Element_ShadowIndex) * self->elementShadowCount );
+		elementTbl = Memory_Alloc_Array(Element_ShadowIndex, self->elementShadowCount, "Element_ShadowIndex_ElementShadowCount" );
 		assert( elementTbl );
 		for( element_sI = 0; element_sI < self->elementShadowCount; element_sI++ ) {
 			elementTbl[element_sI] = Mesh_ElementMapShadowToGlobal( self, element_sI );
@@ -2187,7 +2187,7 @@
 			Element_GlobalIndex*		globalElementTbl;
 			
 			elementCnt = self->elementShadowInfo->procShadowedCnt[nbr_I];
-			globalElementTbl = (Element_GlobalIndex*)malloc( sizeof(Element_GlobalIndex) * elementCnt );
+			globalElementTbl = Memory_Alloc_Array(Element_GlobalIndex, elementCnt, "Element_GlobalIndex_ElementCnt" );
 			assert( globalElementTbl );
 			for( element_lI = 0; element_lI < elementCnt; element_lI++ ) {
 				globalElementTbl[element_lI] = Mesh_ElementMapLocalToGlobal( self,
@@ -2196,7 +2196,7 @@
 			
 			MPI_Send( globalElementTbl, elementCnt, MPI_UNSIGNED, destProc_I, 201, comm );
 			
-			free( globalElementTbl );
+			Memory_Free( globalElementTbl );
 		}
 		
 		/* recieve the feedback, convert to domain indices and store */
@@ -2223,7 +2223,7 @@
 		 */
 		
 		/* convert my shadow node indices to global node indices */
-		nodeTbl = (Node_ShadowIndex*)malloc( sizeof(Node_ShadowIndex) * self->nodeShadowCount );
+		nodeTbl = Memory_Alloc_Array(Node_ShadowIndex, self->nodeShadowCount, "Node_ShadowIndex_nodeShadowCount" );
 		assert( nodeTbl );
 		for( node_sI = 0; node_sI < self->nodeShadowCount; node_sI++ ) {
 			nodeTbl[node_sI] = Mesh_NodeMapShadowToGlobal( self, node_sI );
@@ -2358,7 +2358,7 @@
 			Node_GlobalIndex*		globalNodeTbl;
 			
 			nodeCnt = self->nodeShadowInfo->procShadowedCnt[nbr_I];
-			globalNodeTbl = (Node_GlobalIndex*)malloc( sizeof(Node_GlobalIndex) * nodeCnt );
+			globalNodeTbl = Memory_Alloc_Array( Node_GlobalIndex, nodeCnt, "Node_GlobalIndex_nodeCnt" );
 			assert( globalNodeTbl );
 			for( node_lI = 0; node_lI < nodeCnt; node_lI++ ) {
 				globalNodeTbl[node_lI] = Mesh_NodeMapLocalToGlobal( self,
@@ -2367,7 +2367,7 @@
 			
 			MPI_Send( globalNodeTbl, nodeCnt, MPI_UNSIGNED, destProc_I, 201, comm );
 			
-			free( globalNodeTbl );
+			Memory_Free( globalNodeTbl );
 		}
 		
 		/* recieve the feedback, convert to domain indices and store */
@@ -2403,7 +2403,7 @@
 		}
 		
 		if( request )
-			free( request );
+			Memory_Free( request );
 		
 		
 		/*



More information about the cig-commits mailing list