[yt-svn] commit/yt-3.0: MatthewTurk: Minor change to allocation in ParticleOctree

Bitbucket commits-noreply at bitbucket.org
Sun Aug 19 14:58:42 PDT 2012


1 new commit in yt-3.0:


https://bitbucket.org/yt_analysis/yt-3.0/changeset/8eb1c2c3fe44/
changeset:   8eb1c2c3fe44
branch:      yt-3.0
user:        MatthewTurk
date:        2012-08-19 23:58:35
summary:     Minor change to allocation in ParticleOctree
affected #:  1 file

diff -r c58b01ee9a6d42d167ed61092dcf720efd34b59e -r 8eb1c2c3fe440fd3f4e0f17e868d74462f7bbeec yt/geometry/oct_container.pyx
--- a/yt/geometry/oct_container.pyx
+++ b/yt/geometry/oct_container.pyx
@@ -485,11 +485,10 @@
         self.last_sd = sd
         sd.oct = my_oct
         sd.next = NULL
+        sd.domain_id = <np.int64_t *> malloc(sizeof(np.int64_t) * 32)
         sd.pos = <np.float64_t **> malloc(sizeof(np.float64_t*) * 3)
-        sd.pos[0] = <np.float64_t *> malloc(sizeof(np.float64_t) * 32)
-        sd.pos[1] = <np.float64_t *> malloc(sizeof(np.float64_t) * 32)
-        sd.pos[2] = <np.float64_t *> malloc(sizeof(np.float64_t) * 32)
-        sd.domain_id = <np.int64_t *> malloc(sizeof(np.int64_t) * 32)
+        for i in range(3):
+            sd.pos[i] = <np.float64_t *> malloc(sizeof(np.float64_t) * 32)
         for i in range(32):
             sd.pos[0][i] = sd.pos[1][i] = sd.pos[2][i] = 0.0
             sd.domain_id[i] = -1

Repository URL: https://bitbucket.org/yt_analysis/yt-3.0/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list