Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for SerializeMap handling all keys before all values #2750

Open
cls opened this issue May 31, 2024 · 0 comments
Open

Support for SerializeMap handling all keys before all values #2750

cls opened this issue May 31, 2024 · 0 comments

Comments

@cls
Copy link

cls commented May 31, 2024

While writing an XDR serializer, I found that I was unable to implement SerializeMap - with ints as keys - to support NFSv4's struct fattr4...

struct fattr4 {
    bitmap4         attrmask;
    attrlist4       attr_vals;
};

... without either being able to write all of the keys up front, or otherwise having to buffer all of the serialized values for attr_vals before writing attrmask followed by that data on end(). It would be significantly more memory efficient to serialize all the keys followed by all of the values, but as the documentation for serialize_entry() suggests, the expectation is that formats serialize keys and values together, which does not necessarily hold.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant