Skip to content
Snippets Groups Projects
Commit 64b66ed8 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'cell-split-depth' into 'master'

Add some sanity checking when splitting cells.

Stops after 52 splits. This depth is way beyond our precision.


See merge request !250
parents c8c76ebe 71d36d0c
Branches
Tags
1 merge request!250Add some sanity checking when splitting cells.
...@@ -1269,6 +1269,12 @@ void space_split_mapper(void *map_data, int num_elements, void *extra_data) { ...@@ -1269,6 +1269,12 @@ void space_split_mapper(void *map_data, int num_elements, void *extra_data) {
atomic_cas(&s->maxdepth, maxdepth, c->depth); atomic_cas(&s->maxdepth, maxdepth, c->depth);
} }
/* If the depth is too large, we have a problem and should stop. */
if (maxdepth > space_cell_maxdepth) {
error("Exceeded maximum depth (%d) when splitting cells, aborting",
space_cell_maxdepth);
}
/* Split or let it be? */ /* Split or let it be? */
if (count > space_splitsize || gcount > space_splitsize) { if (count > space_splitsize || gcount > space_splitsize) {
......
...@@ -44,6 +44,9 @@ ...@@ -44,6 +44,9 @@
#define space_stretch 1.10f #define space_stretch 1.10f
#define space_maxreldx 0.25f #define space_maxreldx 0.25f
/* Maximum allowed depth of cell splits. */
#define space_cell_maxdepth 52
/* Split size. */ /* Split size. */
extern int space_splitsize; extern int space_splitsize;
extern int space_maxsize; extern int space_maxsize;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment