Age | Commit message (Collapse) | Author | Files | Lines |
|
When a node is removed from a splay tree, the splay tree was
not using the function splay_tree_delete_key_fn to release the key.
This was causing a leak, fixed by Tom Tromey.
This patch fixes another key leak, that happens when a key equal to
a key already present is inserted. In such a case, we have to release
the old KEY.
Note that this is based on the assumption that the caller always
allocates a new KEY when doing an insert.
Also, clarify the documentation about when the release functions are
called.
2019-02-11 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* splay-tree.h (splay_tree_delete_key_fn): Update comment.
(splay_tree_delete_value_fn): Likewise.
libiberty/ChangeLog
2019-02-11 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* splay-tree.c (splay_tree_insert): Also release old KEY in case
of insertion of a key equal to an already present key.
(splay_tree_new_typed_alloc): Update comment.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268793 138bc75d-0d04-0410-961f-82ee72b054a4
|
|
|
|
include:
* splay-tree.h (splay_tree_compare_strings,
splay_tree_delete_pointers): Declare new utility functions.
libiberty:
2018-05-28 Bernd Edlinger <bernd.edlinger@hotmail.de>
* splay-tree.c (splay_tree_compare_strings,
splay_tree_delete_pointers): New utility functions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@260850 138bc75d-0d04-0410-961f-82ee72b054a4
|
|
|
|
|
|
|
|
Sync with GCC
2014-12-09 Trevor Saunders <tsaunders@mozilla.com>
* hashtab.h, splay-tree.h: Remove GTY markers.
|
|
|
|
|
|
|
|
* splay-tree.h (libi_uhostptr_t): Add gcc specific
__extension__ for long long type case to silent cX9.
(libi_shostptr_t): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
work-a-round whitespace problem in gcc gengtype.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Allow the user to specify functions for allocating memory for
splay tree roots and nodes.
* splay-tree.h (splay_tree_allocate_fn, splay_tree_deallocate_fn):
New types.
(splay_tree): New fields: `allocate', `deallocate', and
`allocate_data'.
(splay_tree_new_with_allocator): New function declaration.
libiberty:
* splay-tree.c (splay_tree_xmalloc_allocate,
splay_tree_xmalloc_deallocate): New functions.
(splay_tree_new): Call splay_tree_new_with_allocator, passing the
above functions and a dummy data pointer.
(splay_tree_new_with_allocator): New function.
(splay_tree_delete_helper, splay_tree_delete, splay_tree_insert,
splay_tree_remove): Use the splay tree's allocation and
deallocation functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|