pnoltes commented on code in PR #470:
URL: https://github.com/apache/celix/pull/470#discussion_r1390439371


##########
libs/utils/src/celix_hash_map.c:
##########
@@ -237,11 +235,12 @@ static void celix_hashMap_addEntry(celix_hash_map_t* map, 
unsigned int hash, con
     newEntry->next = entry;
     map->buckets[bucketIndex] = newEntry;
     if (map->size++ >= celix_hashMap_threshold(map)) {
-        celix_hashMap_resize(map, 2 * map->bucketsSize);
+        return celix_hashMap_resize(map, 2 * map->bucketsSize);

Review Comment:
   IMO it should fail, else we have a error which is not reported or logged to 
celix_err without the users knowing a issue occurred. 
   
   Refactored the hashmap resize so that this is done before creating a new 
entry. When resize fails - or when creating a new entry fails - users still 
have ownership of weakly stored keys. I also updated the header dox for the 
storeKeysWeakly to clarify this. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to