mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
Do not allocate if no adjacencies.
This commit is contained in:
parent
54aa135ac6
commit
bbbb8e279e
1 changed files with 9 additions and 4 deletions
|
@ -88,10 +88,15 @@ void buildZoneAdjacencies(PARTICLE *p, pid_t np,
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
for (int h = 0; h < numZones; h++) {
|
for (int h = 0; h < numZones; h++) {
|
||||||
zt[h].adj = new pid_t[zt[h].nadj];
|
if (zt[h].nadj > 0) {
|
||||||
zt[h].slv = new float[zt[h].nadj];
|
zt[h].adj = new pid_t[zt[h].nadj];
|
||||||
nadjAlloced += zt[h].nadj;
|
zt[h].slv = new float[zt[h].nadj];
|
||||||
zt[h].nadj = 0;
|
nadjAlloced += zt[h].nadj;
|
||||||
|
zt[h].nadj = 0;
|
||||||
|
} else {
|
||||||
|
zt[h].adj = 0;
|
||||||
|
zt[h].slv = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(const std::bad_alloc& a)
|
catch(const std::bad_alloc& a)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue