DragonOS/docs/kernel/libs/id-allocation.md

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则会分配失败。