summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp
diff options
context:
space:
mode:
authorFan Deng <enetor@gmail.com>2017-10-10 16:28:34 -0700
committerChris Johns <chrisj@rtems.org>2018-04-11 11:51:57 +1000
commit64908df11675c36f5b9ca7ec1545ea6b07f9a89a (patch)
treec756ae7174bf45027468af4f17ce506131590a49 /c/src/lib/libbsp
parentReset free count properly in rtems_rfs_bitmap_map_clear_all(). (diff)
downloadrtems-64908df11675c36f5b9ca7ec1545ea6b07f9a89a.tar.bz2
Fixes bitmap allocation accounting logic in rtems-rfs-bitmaps.c
The bitmap allocation accounting logic in rtems-rfs-bitmaps.c is flawed around control->free. Specifically: In rtems_rfs_bitmap_map_set(): control->free is only decremented when its corresponding search bit is toggled. This is wrong and will miss on average 31/32 set updates. In rtems_rfs_bitmap_map_clear(): control->free is incremented unconditionally. The correct behavior is: When updating the map, check if the bit is already set/clear. Only update control->free when the bit is toggled. This change enforced the correct behavior. Tested by inspecting the internal data structure.
Diffstat (limited to 'c/src/lib/libbsp')
0 files changed, 0 insertions, 0 deletions