Allow the user to specify functions for allocating memory for splay tree roots and...
authorJim Blandy <jimb@redhat.com>
Fri, 22 Feb 2002 17:01:23 +0000 (17:01 +0000)
committerJim Blandy <jimb@gcc.gnu.org>
Fri, 22 Feb 2002 17:01:23 +0000 (17:01 +0000)
commit00c2f96f892c11adac80dfec452278e637f43f62
tree4759685426e1fe1ad06d6c7ecee1dac0bf9aff27
parent453c182f826bfda58db799c6dd5b2e2701925c7d
Allow the user to specify functions for allocating memory for splay tree roots and nodes.

include:
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.

From-SVN: r49968
include/ChangeLog
include/splay-tree.h
libiberty/ChangeLog
libiberty/splay-tree.c