Add OPAtomIndexFooter::GetLargestElementSize() to pre-size ReadFrame buffers#154
Conversation
|
Hi @jhursty Could you please take a look at this PR? If you think any changes are needed, kindly let me know. I’m happy to address any feedback! |
|
Hi @jhursty, just a gentle follow-up on this PR when you have some time. Would really appreciate your feedback whenever it's convenient. Thanks! |
|
Thank you for the contribution. I have considered this but do not agree that it is a good idea. The reason is that it changes the behavior of the API. Specifically, the established memory management policy is that the library will not consume huge amounts of memory at the command of an input document. It is the caller that should implement automatic memory expansion should that be desired. (This policy may have exceptions, but those are probably bugs.) If the caller wants automatic memory expansion then similar code can be used where the Alternatively, it might be useful to add a method to |
- Add GetLargestElementSize() method to OPAtomIndexFooter class - Allows callers to query maximum buffer size needed before ReadFrame calls - Revert automatic buffer resizing in Read_EKLV_Packet function - Restore original RESULT_SMALLBUF behavior for insufficient buffer capacity - Maintains established memory management policy per maintainer feedback
e59469a to
5fe51f1
Compare
- Remove automatic buffer resizing code completely - Restore original simple buffer capacity checks - h__Reader.cpp now matches original cinecert/master state
|
@jhursty Thank you for the detailed feedback! I completely understand your concerns about changing the API behavior and the established memory management policy. You're absolutely right that the library should not automatically consume large amounts of memory. I've completely reworked this PR based on your suggestion. I have:
|
|
I may have made a poor choice of word by writing "delta" since the index group contains a property The difference between two adjacent Note that in the |
|
Getting closer!
Thank you for your contribution! |
|
@jhursty Thanks for the detailed feedback! I have addressed your PR comment.
Last element via partition pack position** — implemented as Last element via partition pack position** — implemented as m_IndexAccess.m_ECOffset = m_HeaderPart.BodyOffset;This way Verification
|
This PR adds a small helper API to let callers size their frame buffer before calling ReadFrame(), avoiding RESULT_SMALLBUF without changing the library’s memory-management behavior.