gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated (25333278f -> efe6acf1e)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (25333278f -> efe6acf1e)
Date: Tue, 19 Feb 2019 11:37:21 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a change to branch master
in repository gnunet.

    from 25333278f fix #5586
     new 663601078 remove duplicate valgrind
     new d76ca4e2e additional santity check for MQ users
     new efe6acf1e fix grow behavior of hash map for very large maps

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/fs/fs.conf.in                 |  1 -
 src/util/container_multihashmap.c | 23 ++++++++++++-----------
 src/util/mq.c                     |  1 +
 3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/fs/fs.conf.in b/src/fs/fs.conf.in
index bd1d04001..1e4c5c268 100644
--- a/src/fs/fs.conf.in
+++ b/src/fs/fs.conf.in
@@ -60,7 +60,6 @@ DISABLE_ANON_TRANSFER = NO
 # well anyway, so better have a moderate cap.
 MAX_CADET_CLIENTS = 128
 
-PREFIX = valgrind
 
 [gnunet-auto-share]
 BINARY = gnunet-auto-share
diff --git a/src/util/container_multihashmap.c 
b/src/util/container_multihashmap.c
index cf5c2a334..7605ea151 100644
--- a/src/util/container_multihashmap.c
+++ b/src/util/container_multihashmap.c
@@ -11,7 +11,7 @@
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      Affero General Public License for more details.
-    
+
      You should have received a copy of the GNU Affero General Public License
      along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
@@ -417,7 +417,7 @@ GNUNET_CONTAINER_multihashmap_iterate (struct 
GNUNET_CONTAINER_MultiHashMap *map
       }
     }
   }
-  GNUNET_assert (--map->next_cache_off < NEXT_CACHE_SIZE);    
+  GNUNET_assert (--map->next_cache_off < NEXT_CACHE_SIZE);
   return count;
 }
 
@@ -764,18 +764,19 @@ grow (struct GNUNET_CONTAINER_MultiHashMap *map)
   unsigned int new_len;
   unsigned int idx;
 
-  map->modification_counter++;
-
   old_map = map->map;
   old_len = map->map_length;
+  GNUNET_assert (0 != old_len);
   new_len = old_len * 2;
-  /* if we would exceed heap size limit for the _first_ time,
-     try staying just below the limit */
-  if ( (new_len * sizeof (union MapEntry) > GNUNET_MAX_MALLOC_CHECKED) &&
-       ((old_len+1) * sizeof (union MapEntry) < GNUNET_MAX_MALLOC_CHECKED) )
-    new_len = GNUNET_MAX_MALLOC_CHECKED / sizeof (union MapEntry);
-  new_map = GNUNET_new_array (new_len,
-                              union MapEntry);
+  if (0 == new_len) /* 2^31 * 2 == 0 */
+    new_len = old_len; /* never use 0 */
+  if (new_len == old_len)
+    return; /* nothing changed */
+  new_map = GNUNET_malloc_large (new_len *
+                                 sizeof (union MapEntry));
+  if (NULL == new_map)
+    return; /* grow not possible */
+  map->modification_counter++;
   map->map_length = new_len;
   map->map = new_map;
   for (unsigned int i = 0; i < old_len; i++)
diff --git a/src/util/mq.c b/src/util/mq.c
index d2f5add19..72ab8b72d 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -964,6 +964,7 @@ GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev)
   {
     /* complex case, we already started with transmitting
        the message using the callbacks. */
+    GNUNET_assert (GNUNET_NO == mq->in_flight);
     GNUNET_assert (0 < mq->queue_length);
     mq->queue_length--;
     mq->cancel_impl (mq,

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]