Commit Graph
3 Commits
Author SHA1 Message Date
Augustin Cavalier 88275138ba kernel/util: Implement more features in the Bitmap class.
* Resize(): adds more space to the end of the bitmap.
 * Shift(): moves all bits in the map up or down.
 * Use size_t instead of int for indexes.

Also add unit tests for the new functions (they seem to be passing.)

Reference material for shift implementation:
https://github.com/ecsv/linux-like-bitops/blob/2c56d43c1ebc9fc0dddc0149a374d096198372a9/bitops.h#L977

Change-Id: Ia85768aaeed7bd3ffef3a9f575f05331e048fe50
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5146
Reviewed-by: waddlesplash <[email protected]>
2022-03-30 20:17:50 +00:00
Pawel Dziepak 4cba4ff1df kernel/util: Use private/kernel/debug.h 2013-10-08 01:36:30 +02:00
Pawel Dziepak 149c82a8ec kernel/util: Add bitmap implementation 2013-10-03 04:27:49 +02:00