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

Method erase

libCacheSim/dataStructure/sparsepp/spp.h:1581–1596  ·  view source on GitHub ↗

This takes the specified elements out of the group. This is "undefining", rather than "clearing". TODO(austern): Make this exception safe: handle exceptions from value_type's copy constructor. ---------------------------------------------------------------

Source from the content-addressed store, hash-verified

1579 // value_type's copy constructor.
1580 // ---------------------------------------------------------------
1581 void erase(allocator_type &alloc, size_type i)
1582 {
1583 if (_bmtest(i))
1584 {
1585 // trivial to erase empty bucket
1586 if (_num_items() == 1)
1587 clear(alloc, false);
1588 else
1589 {
1590 _group_erase(alloc, pos_to_offset(i));
1591 _decr_num_items();
1592 _bmclear(i);
1593 }
1594 _bme_set(i); // remember that this position has been erased
1595 }
1596 }
1597
1598 // I/O
1599 // We support reading and writing groups to disk. We don't store

Callers 6

resizeMethod · 0.45
eraseMethod · 0.45
eraseMethod · 0.45
eraseMethod · 0.45
eraseMethod · 0.45
eraseMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected