DragonOS/docs/kernel/libs/id-allocation.md
LoGin 013ffb708f
feat(ida): IDA内部改为使用XArray实现 (#934)
目前可以记录哪些ID已经分配,支持了ID释放的功能.

Signed-off-by: longjin <longjin@DragonOS.org>
2024-09-25 11:20:52 +08:00

12 lines
360 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ID分配
:::{note}
本文作者:龙进 <longjin@DragonOS.org>
2024年9月25日
:::
内核提供了一个名为`IdAllocator`的ID分配器位于`kernel/crates/ida`中。
它能够分配、释放ID。默认它会自增分配假如ID大于设定的最大值它会从最小值开始寻找空闲ID。如果没有空闲的ID则会分配失败。