I could specify a limit by adding the following two bold lines to my handle "map":
...
53. if (!map || !name || !val)
54. return -EINVAL;
55. if (map->count > count_limit)
56. return -ELIMIT;
57. pair = bk_alloc(sizeof(struct bk_strmap));
...
So, add a limit flag to your map handle. ☺
--
Silvio Clécio
zen...@gmail.com
unread,
Apr 25, 2018, 5:33:30 PM4/25/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to uthash
Thanks, Silvio. Adding a count test (against the HASH_COUNT macro) to an add wrapper function makes sense, just wanted to make sure there wasn't anything built in first. The trick now will be to handle such cases by freeing up room in the hash table, preferably starting with the oldest records.