Beta - Fix memory overlap in DeviceBuffer #272
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes
With PR #253 the limitation for the max devices per type was eliminated.
Before this PR memory was allocated in the device buffer for each single device. The highest amount of memory is 31 byte for one encoder.
Now the memory gets allocated in the device buffer for all devices of one type at once. If the required memory is more than 255 bytes, e.g. 9 encoders need 9 * 31bytes = 279 bytes, only 23 bytes gets reserved as the size to allocate memory is limited to a byte.
In
allocateMem.cpp/.h
the variablesize
within the functionsallocateMemory()
andFitInMemory()
must be defined asuint16_t
.Fixes #271