mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 07:11:12 +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
|
||||
{
|
||||
for (int h = 0; h < numZones; h++) {
|
||||
zt[h].adj = new pid_t[zt[h].nadj];
|
||||
zt[h].slv = new float[zt[h].nadj];
|
||||
nadjAlloced += zt[h].nadj;
|
||||
zt[h].nadj = 0;
|
||||
if (zt[h].nadj > 0) {
|
||||
zt[h].adj = new pid_t[zt[h].nadj];
|
||||
zt[h].slv = new float[zt[h].nadj];
|
||||
nadjAlloced += zt[h].nadj;
|
||||
zt[h].nadj = 0;
|
||||
} else {
|
||||
zt[h].adj = 0;
|
||||
zt[h].slv = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(const std::bad_alloc& a)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue