HomeClusterLabs Projects

Refactor: libcrmcommon: Use GByteArray for the crm_ipc_s buffer.
f273fd5c22f9Unpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Refactor: libcrmcommon: Use GByteArray for the crm_ipc_s buffer.

This has the built-in advantage of various library functions that can be
used to manipulate it instead of using pointer arithmetic. For the
moment, this isn't important but it will become important later when
we're doing split up IPC messages.

On the other hand, there's a couple other changes here that are not
advantages. First, instead of reading directly into the GByteArray, we
now have to allocate a buffer to read into, and then append that to the
GByteArray. This also means we need to be careful about freeing that
buffer.

Second, because there's no way to clear out a GByteArray and inserting
new bytes directly at the beginning, we just need to allocate and free
it every time we do a read. This also means we need to be more careful
about checking if it's NULL. This will be less of a problem later when
we are reading into the same GByteArray multiple times for a split up
message.

Details

Provenance
clumensAuthored on Apr 10 2025, 9:51 AM
Parents
rP1fb7b4050985: Merge pull request #3869 from nrwahl2/nrwahl2-regression
Branches
Unknown
Tags
Unknown

Event Timeline