aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include/alSource.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-01-27 01:51:01 -0800
committerChris Robinson <[email protected]>2018-01-27 01:51:01 -0800
commit9613b4bfe24cbefba0f4c9c738ebd30d4b116970 (patch)
tree99c21c7dd7834f8bc9b44db7801e2d77c1df4030 /OpenAL32/Include/alSource.h
parent5d2196c119f376ca6e58e23b43d4ffbaf4c68c12 (diff)
Use a different method for storing and looking up buffers
Rather than each buffer being individually allocated with a generated 'thunk' ID that's used with a uint:ptr map, buffers are allocated in arrays of 64 within a vector. Each group of 64 has an associated 64-bit mask indicating which are free to use, and the buffer ID is comprised of the two array indices which directly locate the buffer (no searching, binary or otherwise). Currently no buffers are actually deallocated after being allocated, though they are reused. So an app that creates a ton of buffers once, then deletes them all and uses only a couple from then on, will have a bit of waste, while an app that's more consistent with the number of used buffers won't be a problem. This can be improved by removing elements of the containing vector that contain all-free buffers while there are plenty of other free buffers. Also, this method can easily be applied to other resources, like sources.
Diffstat (limited to 'OpenAL32/Include/alSource.h')
0 files changed, 0 insertions, 0 deletions