[GRASS-SVN] r73278 - grass/trunk/imagery/i.segment

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Sep 7 00:50:24 PDT 2018


Author: mmetz
Date: 2018-09-07 00:50:23 -0700 (Fri, 07 Sep 2018)
New Revision: 73278

Modified:
   grass/trunk/imagery/i.segment/open_files.c
Log:
i.segment: fix memory management estimation

Modified: grass/trunk/imagery/i.segment/open_files.c
===================================================================
--- grass/trunk/imagery/i.segment/open_files.c	2018-09-06 20:51:22 UTC (rev 73277)
+++ grass/trunk/imagery/i.segment/open_files.c	2018-09-07 07:50:23 UTC (rev 73278)
@@ -527,6 +527,8 @@
 
 	/* calculate number of region stats that can be kept in memory */
 	reg_size_count = (globals->mb - segs_mb) / reg_size_mb;
+	if (reg_size_count < 1)
+	    reg_size_count = 1;
 	globals->min_reg_size = 3;
 	if (reg_size_count < (double) globals->notnullcells / globals->min_reg_size) {
 	    globals->min_reg_size = (double) globals->notnullcells / reg_size_count;



More information about the grass-commit mailing list