X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=include%2Fsplay-tree.h;h=da533dec183ffa15ebfe0a87e42635090fdfc522;hb=e0b2a78c83207340f6c4b5dbe02bec850dbb7def;hp=0d262729435e254fae00653d8aa67b494b73c6f7;hpb=827041555ac443bd57340060f3e034fd7b199dd8;p=deliverable%2Fbinutils-gdb.git diff --git a/include/splay-tree.h b/include/splay-tree.h index 0d26272943..da533dec18 100644 --- a/include/splay-tree.h +++ b/include/splay-tree.h @@ -58,11 +58,18 @@ typedef struct splay_tree_node_s *splay_tree_node; typedef int (*splay_tree_compare_fn) (splay_tree_key, splay_tree_key); /* The type of a function used to deallocate any resources associated - with the key. */ + with the key. If you provide this function, the splay tree + will take the ownership of the memory of the splay_tree_key arg + of splay_tree_insert. This function is called to release the keys + present in the tree when calling splay_tree_delete or splay_tree_remove. + If splay_tree_insert is called with a key equal to a key already + present in the tree, the old key and old value will be released. */ typedef void (*splay_tree_delete_key_fn) (splay_tree_key); /* The type of a function used to deallocate any resources associated - with the value. */ + with the value. If you provide this function, the memory of the + splay_tree_value arg of splay_tree_insert is managed similarly to + the splay_tree_key memory: see splay_tree_delete_key_fn. */ typedef void (*splay_tree_delete_value_fn) (splay_tree_value); /* The type of a function used to iterate over the tree. */