Print this page
6222 libuutil could provide a way to re-create an AVL tree
*** 19,32 ****
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
- #pragma ident "%Z%%M% %I% %E% SMI"
-
#include "libuutil_common.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
--- 19,32 ----
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
*/
#include "libuutil_common.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
*** 272,281 ****
--- 272,291 ----
avl_destroy(&ap->ua_tree);
uu_free(ap);
}
+ void
+ uu_avl_recreate(uu_avl_t *ap)
+ {
+ uu_avl_pool_t *pp = ap->ua_pool;
+
+ avl_destroy(&ap->ua_tree);
+ avl_create(&ap->ua_tree, &uu_avl_node_compare, pp->uap_objsize,
+ pp->uap_nodeoffset);
+ }
+
size_t
uu_avl_numnodes(uu_avl_t *ap)
{
return (avl_numnodes(&ap->ua_tree));
}