MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / read_metadata

Method read_metadata

libCacheSim/dataStructure/sparsepp/spp.h:1615–1628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1613
1614 // Reading destroys the old group contents! Returns true if all was ok.
1615 template <typename INPUT> bool read_metadata(allocator_type &alloc, INPUT *fp)
1616 {
1617 clear(alloc, true);
1618
1619 if (!sparsehash_internal::read_data(fp, &_bitmap, sizeof(_bitmap)))
1620 return false;
1621
1622 // We'll allocate the space, but we won't fill it: it will be
1623 // left as uninitialized raw memory.
1624 uint32_t num_items = spp_popcount(_bitmap); // yes, _num_buckets not set
1625 _set_num_items(num_items);
1626 _group = num_items ? _allocate_group(alloc, num_items/* , true */) : 0;
1627 return true;
1628 }
1629
1630 // Again, only meaningful if value_type is a POD.
1631 template <typename INPUT> bool read_nopointer_data(INPUT *fp)

Callers 4

read_metadataMethod · 0.45
read_metadataMethod · 0.45
read_metadataMethod · 0.45
read_metadataMethod · 0.45

Calls 2

spp_popcountFunction · 0.85
read_dataFunction · 0.70

Tested by

no test coverage detected