You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the ISO15118 -2 and -20 some arrays have become increasingly large (ie: signatures, certs, schedules) making it harder to keep on the stack with another application running on top of it, especially on some embedded devices.
The issue lies in that these blocks need to be pre-allocated in a single uber-struct with everything in it, even if not all elements are filled (full cert with a full schedules of all kinds). We are forced to pay for what we don't use.
Describe your solution
Ideally an arena allocator may be used with the exi stream that will only make room for the elements that are required.
at the end of the decode the stream will contain the allocator of the message, so you can't simply empty it if you still need it. I do think this is worth the tradeoff though.
Alternatively an allocator for a specific field may be used:
But then we can't clear data with a simple memset anymore.
Additional context
This also makes it easier to "ignore" out of range items without throwing an error. You can keep decoding until you reach the end of the list, you're "just" missing the later items, which may be better than error out the charging session if it's not an important part, though I suspect this won't have many other usecases outside of an underpowered microcontroller.
In scenarios where few EVs use all elements of these arrays this can have a much smaller footprint and the allocator can be decreased, making up more resources for the rest of the system.
The text was updated successfully, but these errors were encountered:
Describe the problem
In the ISO15118 -2 and -20 some arrays have become increasingly large (ie: signatures, certs, schedules) making it harder to keep on the stack with another application running on top of it, especially on some embedded devices.
The issue lies in that these blocks need to be pre-allocated in a single uber-struct with everything in it, even if not all elements are filled (full cert with a full schedules of all kinds). We are forced to pay for what we don't use.
Describe your solution
Ideally an arena allocator may be used with the exi stream that will only make room for the elements that are required.
ie:
at the end of the decode the stream will contain the allocator of the message, so you can't simply empty it if you still need it. I do think this is worth the tradeoff though.
Alternatively an allocator for a specific field may be used:
Then the user would have to set this before starting decoding:
But then we can't clear data with a simple memset anymore.
Additional context
This also makes it easier to "ignore" out of range items without throwing an error. You can keep decoding until you reach the end of the list, you're "just" missing the later items, which may be better than error out the charging session if it's not an important part, though I suspect this won't have many other usecases outside of an underpowered microcontroller.
In scenarios where few EVs use all elements of these arrays this can have a much smaller footprint and the allocator can be decreased, making up more resources for the rest of the system.
The text was updated successfully, but these errors were encountered: