8 byte alignment on capn_segment, updated comments about this.

As discussed in PR: https://github.com/opensourcerouting/c-capnproto/pull/15#discussion_r107588334
This commit is contained in:
Alex Helfet 2017-03-23 05:11:45 +00:00
parent 57d0ffea33
commit 408505ae31
2 changed files with 14 additions and 8 deletions

View file

@ -103,18 +103,19 @@ struct capn_tree *capn_tree_insert(struct capn_tree *root, struct capn_tree *n);
*
* cap specifies the segment capacity.
*
* When creating new structures len will be incremented until it reaces cap,
* When creating new structures len will be incremented until it reaches cap,
* at which point a new segment will be requested via capn->create. The
* create callback can either create a new segment or expand an existing
* one by incrementing cap and returning the expanded segment.
*
* data, len, and cap must all by 8 byte aligned
* data, len, and cap must all be 8 byte aligned, hence the ALIGNED_(8) macro
* on the struct definition.
*
* data, len, cap, and user should all set by the user. Other values
* data, len, cap, and user should all be set by the user. Other values
* should be zero initialized.
*/
struct ALIGNED_(64) capn_segment {
struct ALIGNED_(8) capn_segment {
struct capn_tree hdr;
struct capn_segment *next;
struct capn *capn;