Bug 10087 - RMC: RMC Project - reduce memory copying
Summary: RMC: RMC Project - reduce memory copying
Status: RESOLVED OBSOLETE
Alias: None
Product: BSPs
Classification: Build System, Metadata & Runtime
Component: bsps-meta-intel (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Low enhancement
Target Milestone: 2.4
Assignee: Ng, Wei Tee
QA Contact:
URL:
Whiteboard:
Depends on: 10086
Blocks:
  Show dependency tree
 
Reported: 2016-08-04 20:43 UTC by Jianxun Zhang
Modified: 2017-05-22 16:55 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jianxun Zhang 2016-08-04 20:43:51 UTC
Sometimes what a RMC client wants is just fetch a file blob and treat content as a string. But in this case a client has to re-alloc memory to add a '\0' at the end of string.

I think RMC library can always alloc one extra byte of true length of file blob, and always set '\0' in the last byte. The true length of file blob will be still returned without +1 to be compatible for other scenarios.

With this trick, clients won't need to copy the content when they only want to read string.

Freeing memory allocated by RMC API shouldn't be affected since free functions don't take length.
Comment 1 Jianxun Zhang 2016-10-31 20:05:57 UTC
This task depends on the major change tracked in 10086.
Comment 2 Todor Minchev 2017-03-20 16:29:01 UTC
Performance can be also improved in write_fingerprint_file (src/rmc.c). Please see the TODO comment.
Comment 3 Todor Minchev 2017-05-22 16:55:09 UTC
Does not apply to RMC2.