Closed quic-egmc closed 12 months ago
@serge1 please take a look at this small enhancement and let me know if there's anything more I can describe, thanks!
@serge1 just a reminder - this is really useful when dealing with files that contain multiple large ELF segments as it provides a way to minimize memory consumption by freeing segment data after it is used. Thanks again!
Hi, Thank you for your submission! I'm out of the town at these days, returning back in two weeks. I'll review your changes upon my return.
Accepted. Thank you very much!
Unfortunately, it is possible to use this function only in condition that elfio object was loaded in 'lazy' mode. Otherwise, a second attempt to access segment's data will lead to a problem as the input stream is already closed/destroyed.
Unfortunately, it is possible to use this function only in condition that elfio object was loaded in 'lazy' mode. Otherwise, a second attempt to access segment's data will lead to a problem as the input stream is already closed/destroyed.
Got it - in that case perhaps we should only allow this if is_lazy was set to begin with. That would also require that we do not clear is_lazy in load_data since we need to preserve it to indicate "stream is still open". Since I suspect the reason for clearing it was to prevent unnecessary re-loads of data a new flag like is_loaded may be required.
Allow for segment data to be freed to allow for reduced memory usage when dealing with large elf segments.