freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Alloc only required # of updates


From: Richard Guenther
Subject: [PATCH] Alloc only required # of updates
Date: Tue, 30 Dec 2003 18:48:41 +0100 (CET)

Hi!

This patch changes the calcGCFillList routines to reserve only the
required amount of entries in the list.  Tested with Layout tests and an
assert checking the resulting size is not larger than the reserved one.

Ok?

Richard.


2003Dec30  Richard Guenther <address@hidden>

        * src/Layout/GridLayout.cpp: allocate 2*Dim*local_m.size()
        fill list nodes only.
        src/Layout/UniformGridLayout.cpp: likewise.

Index: GridLayout.cpp
===================================================================
RCS file: /home/pooma/Repository/r2/src/Layout/GridLayout.cpp,v
retrieving revision 1.89
diff -u -u -r1.89 GridLayout.cpp
--- GridLayout.cpp      11 Mar 2003 21:30:44 -0000      1.89
+++ GridLayout.cpp      30 Dec 2003 17:42:22 -0000
@@ -366,7 +366,7 @@
   // the upward copies first, then the downward copies.

   int numPatches = this->all_m.size();
-  this->gcFillList_m.reserve(2*Dim*numPatches);
+  this->gcFillList_m.reserve(2*Dim*this->local_m.size());

   // Make sure we have the same number of patches as blocks in the grid
   // (this is just a sanity check).
Index: UniformGridLayout.cpp
===================================================================
RCS file: /home/pooma/Repository/r2/src/Layout/UniformGridLayout.cpp,v
retrieving revision 1.40
diff -u -u -r1.40 UniformGridLayout.cpp
--- UniformGridLayout.cpp       11 Mar 2003 21:30:44 -0000      1.40
+++ UniformGridLayout.cpp       30 Dec 2003 17:42:25 -0000
@@ -299,7 +299,7 @@

     int numPatches = this->all_m.size();

-    this->gcFillList_m.reserve(2*Dim*numPatches); // a bit extra
+    this->gcFillList_m.reserve(2*Dim*this->local_m.size());

     for (d = 0; d < Dim; ++d)
       {

reply via email to

[Prev in Thread] Current Thread [Next in Thread]