MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / gettoalign

Function gettoalign

deps/lua/src/lua_struct.c:137–142  ·  view source on GitHub ↗

** return number of bytes needed to align an element of size 'size' ** at current position 'len' */

Source from the content-addressed store, hash-verified

135** at current position 'len'
136*/
137static int gettoalign (size_t len, Header *h, int opt, size_t size) {
138 if (size == 0 || opt == 'c') return 0;
139 if (size > (size_t)h->align)
140 size = h->align; /* respect max. alignment */
141 return (size - (len & (size - 1))) & (size - 1);
142}
143
144
145/*

Callers 3

b_packFunction · 0.85
b_unpackFunction · 0.85
b_sizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected