Mercurial > hg > CbC > CbC_gcc
diff include/splay-tree.h @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
line wrap: on
line diff
--- a/include/splay-tree.h Thu Oct 25 07:37:49 2018 +0900 +++ b/include/splay-tree.h Thu Feb 13 11:34:05 2020 +0900 @@ -1,5 +1,5 @@ /* A splay-tree datatype. - Copyright (C) 1998-2018 Free Software Foundation, Inc. + Copyright (C) 1998-2020 Free Software Foundation, Inc. Contributed by Mark Mitchell (mark@markmitchell.com). This file is part of GCC. @@ -58,11 +58,18 @@ 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. */