MCPcopy Create free account
hub / github.com/NetSys/bess / ComputeNextOffset

Function ComputeNextOffset

core/metadata.cc:51–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49// Helpers -----------------------------------------------------------------
50
51static mt_offset_t ComputeNextOffset(mt_offset_t curr_offset, int8_t size) {
52 uint32_t overflow;
53 int8_t rounded_size;
54
55 rounded_size = align_ceil_pow2(size);
56
57 if (curr_offset % rounded_size) {
58 curr_offset = align_ceil(curr_offset, rounded_size);
59 }
60
61 overflow = (uint32_t)curr_offset + (uint32_t)size;
62
63 return overflow > kMetadataTotalSize ? kMetadataOffsetNoSpace : curr_offset;
64}
65
66// Generate warnings for modules that read metadata that never gets set.
67static void CheckOrphanReaders() {

Callers 1

AssignOffsetsMethod · 0.85

Calls 2

align_ceil_pow2Function · 0.85
align_ceilFunction · 0.85

Tested by

no test coverage detected