diff options
author | Tucker Evans <tucker@tuckerevans.com> | 2020-07-06 20:07:45 -0400 |
---|---|---|
committer | Tucker Evans <tucker@tuckerevans.com> | 2020-07-08 11:02:44 -0400 |
commit | 7d69ea177200bda62b403eb9ead6eee2ba5abe52 (patch) | |
tree | cad2e1fd9810ca300d7219230aa1819ce1ff11f2 /collections/map/map.h | |
parent | 51d368c20e1d93970a94cb0d2aff10654922bb37 (diff) |
Add reset key function for maps
Allows changing the pointer to key when they are equivalent (by cmp
function), to avoid memory leaks that could happen if we assumed either
pointer was to be freed or overwritten.
Diffstat (limited to 'collections/map/map.h')
-rw-r--r-- | collections/map/map.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/collections/map/map.h b/collections/map/map.h index b389d87..a5fc816 100644 --- a/collections/map/map.h +++ b/collections/map/map.h @@ -12,6 +12,7 @@ int map_size(map*); /*data*/ int map_insert(map*, void*, void*); +void* map_reset_key(map*, void*); /*memory*/ void map_clear(map*); |