Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
16424 libavl should expose avl_update{,_lt,_gt}
Reviewed by: Bill Sommerfeld <sommerfeld@hamachi.org> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Dan McDonald <danmcd@mnx.io>
- Loading branch information
Showing
6 changed files
with
136 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
.\" | ||
.\" This file and its contents are supplied under the terms of the | ||
.\" Common Development and Distribution License ("CDDL"), version 1.0. | ||
.\" You may only use this file in accordance with the terms of version | ||
.\" 1.0 of the CDDL. | ||
.\" | ||
.\" A full copy of the text of the CDDL should have accompanied this | ||
.\" source. A copy of the CDDL is also available via the Internet at | ||
.\" http://www.illumos.org/license/CDDL. | ||
.\" | ||
.\" | ||
.\" Copyright 2024 Oxide Computer Company | ||
.\" | ||
.Dd Jan 27, 2024 | ||
.Dt AVL_UPDATE 3AVL | ||
.Os | ||
.Sh NAME | ||
.Nm avl_update , | ||
.Nm avl_update_gt , | ||
.Nm avl_update_lt | ||
.Nd reinsert a node if its order has changed | ||
.Sh SYNOPSIS | ||
.Lb libavl | ||
.In sys/avl.h | ||
.Ft boolean_t | ||
.Fo avl_update | ||
.Fa "avl_tree_t *tree" | ||
.Fa "void *node" | ||
.Fc | ||
.Ft boolean_t | ||
.Fo avl_update_gt | ||
.Fa "avl_tree_t *tree" | ||
.Fa "void *node" | ||
.Fc | ||
.Ft boolean_t | ||
.Fo avl_update_lt | ||
.Fa "avl_tree_t *tree" | ||
.Fa "void *node" | ||
.Fc | ||
.Sh DESCRIPTION | ||
The | ||
.Fn avl_update | ||
function re-inserts | ||
.Fa node | ||
into | ||
.Fa tree | ||
only if its order has changed relative to its nearest neighbors. | ||
To optimize performance, | ||
.Fn avl_update_lt | ||
checks only the previous node and | ||
.Fn avl_update_gt | ||
checks only the next node. | ||
Use | ||
.Fn avl_update_lt | ||
and | ||
.Fn avl_update_gt | ||
only if you know the direction in which the order of the node may change. | ||
.Sh RETURN VALUES | ||
The | ||
.Fn avl_update , | ||
.Fn avl_update_lt | ||
and | ||
.Fn avl_update_gt | ||
functions return | ||
.Sy B_TRUE | ||
if it was necessary to relocate the node due its order having changed | ||
relative to its nearest neighbors and | ||
.Sy B_FALSE | ||
otherwise. | ||
.Sh EXAMPLES | ||
See the | ||
.Sy EXAMPLES | ||
section in | ||
.Xr libavl 3LIB . | ||
.Sh INTERFACE STABILITY | ||
.Sy Committed | ||
.Sh MT-Level | ||
See | ||
.Sx Locking | ||
in | ||
.Xr libavl 3LIB . | ||
.Sh SEE ALSO | ||
.Xr libavl 3LIB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters