Skip to content

Commit 7974764

Browse files
Lori Whippler HollaschLori Whippler Hollasch
authored andcommitted
Merged PR 22209: Fix description of RTL_USE_AVL_TABLES
Fix description of RTL_USE_AVL_TABLES Per UUF 508618
2 parents 1df1cf4 + 4408e8f commit 7974764

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

wdk-ddi-src/content/ntddk/nf-ntddk-rtlinitializegenerictable.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ UID: NF:ntddk.RtlInitializeGenericTable
33
title: RtlInitializeGenericTable function (ntddk.h)
44
description: The RtlInitializeGenericTable routine initializes a generic table.
55
tech.root: ifsk
6-
ms.date: 01/10/2023
6+
ms.date: 11/13/2025
77
keywords: ["RtlInitializeGenericTable function"]
88
ms.keywords: RtlInitializeGenericTable, RtlInitializeGenericTable routine [Installable File System Drivers], ifsk.rtlinitializegenerictable, ntddk/RtlInitializeGenericTable, rtlref_2ef380c8-bc8a-4711-b0d1-b1c669818f2c.xml
99
req.header: ntddk.h
@@ -149,7 +149,7 @@ The caller-supplied *CompareRoutine* is called before the *AllocateRoutine* to l
149149
By default, the operating system uses splay trees to implement generic tables. Under some circumstances, operations on a splay tree will make the tree deep and narrow and might even turn it into a straight line. Very deep trees degrade the performance of searches. You can ensure a more balanced, shallower tree implementation of generic tables by using Adelson-Velsky/Landis (AVL) trees. If you want to configure the generic table routines to use AVL trees instead of splay trees in your driver, insert the following define statement in a common header file before including *Ntddk.h*:
150150
151151
```cpp
152-
`#define RTL_USE_AVL_TABLES 0`
152+
`#define RTL_USE_AVL_TABLES 1`
153153
```
154154

155155
If you want to use AVL tables and if RTL_USE_AVL_TABLES is not defined, you must use the AVL form of the generic table routines. For example, use the [RtlInitializeGenericTableAvl](./nf-ntddk-rtlinitializegenerictableavl.md) routine instead of **RtlInitializeGenericTable**. **RtlInitializeGenericTableAvl** returns an initialized [**RTL_AVL_TABLE**](./ns-ntddk-_rtl_avl_table.md) table structure in the buffer to which the *Table* parameter points. In the call to **RtlInitializeGenericTableAvl**, the caller must pass a PRTL_AVL_COMPARE_ROUTINE-typed comparison callback routine, a PRTL_AVL_ALLOCATE_ROUTINE-typed allocation callback routine, and a PRTL_AVL_FREE_ROUTINE-typed deallocation callback routine rather than the similar PRTL_GENERIC_*Xxx*-typed routines.

wdk-ddi-src/content/ntddk/nf-ntddk-rtlinitializegenerictableavl.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ UID: NF:ntddk.RtlInitializeGenericTableAvl
33
title: RtlInitializeGenericTableAvl function (ntddk.h)
44
description: The RtlInitializeGenericTableAvl routine initializes a generic table using Adelson-Velsky/Landis (AVL) trees.
55
tech.root: ifsk
6-
ms.date: 01/10/2023
6+
ms.date: 11/13/2025
77
keywords: ["RtlInitializeGenericTableAvl function"]
88
ms.keywords: RtlInitializeGenericTableAvl, RtlInitializeGenericTableAvl routine [Installable File System Drivers], ifsk.rtlinitializegenerictableavl, ntddk/RtlInitializeGenericTableAvl
99
req.header: ntddk.h
@@ -146,13 +146,7 @@ Callers of the *Rtl...GenericTableAvl* routines are responsible for exclusively
146146
147147
The caller-supplied *CompareRoutine* is called before the *AllocateRoutine* to locate an appropriate location at which a new element should be inserted. The *CompareRoutine* also is called before the *FreeRoutine* to locate an element to be deleted.
148148
149-
The **RtlInitializeGenericTableAvl** routine explicitly allocates a generic table that uses AVL trees. Use of this routine and the other *Rtl...GenericTableAvl* routines is necessary when AVL tree based tables are desired and RTL_USE_AVL_TABLES is not define before including *Ntddk.h*.
150-
151-
If you want to configure the generic table routines, *Rtl...GenericTable*, to use AVL trees instead of splay trees in your driver, insert the following define statement in a common header file before including *Ntddk.h*:
152-
153-
```cpp
154-
`#define RTL_USE_AVL_TABLES 0`
155-
```
149+
The **RtlInitializeGenericTableAvl** routine explicitly allocates a generic table that uses AVL trees. Use of this routine and the other *Rtl...GenericTableAvl* routines is necessary when AVL tree based tables are desired and RTL_USE_AVL_TABLES is not defined before including *Ntddk.h*.
156150
157151
Callers of **RtlInitializeGenericTableAvl** must be running at IRQL <= DISPATCH_LEVEL. Note that if *Rtl...GenericTableAvl* routines are to be used at IRQL DISPATCH_LEVEL, the *CompareRoutine*, *AllocateRoutine*, and *FreeRoutine* must all be nonpageable code, and the *AllocateRoutine* should allocate memory from nonpaged pool.
158152

0 commit comments

Comments
 (0)