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

Method clear

libCacheSim/dataStructure/sparsepp/spp.h:2981–2990  ·  view source on GitHub ↗

It's always nice to be able to clear a table without deallocating it

Source from the content-addressed store, hash-verified

2979
2980 // It's always nice to be able to clear a table without deallocating it
2981 void clear()
2982 {
2983 if (!empty() || num_deleted != 0)
2984 {
2985 table.clear();
2986 table = Table(HT_DEFAULT_STARTING_BUCKETS, table.get_allocator());
2987 }
2988 settings.reset_thresholds(bucket_count());
2989 num_deleted = 0;
2990 }
2991
2992 // LOOKUP ROUTINES
2993private:

Callers

nothing calls this directly

Calls 5

emptyFunction · 0.85
TableClass · 0.85
reset_thresholdsMethod · 0.80
clearMethod · 0.45
get_allocatorMethod · 0.45

Tested by

no test coverage detected