MCPcopy Create free account
hub / github.com/ElementsProject/elements / setup_bytes

Method setup_bytes

src/cuckoocache.h:363–366  ·  view source on GitHub ↗

setup_bytes is a convenience function which accounts for internal memory * usage when deciding how many elements to store. It isn't perfect because * it doesn't account for any overhead (struct size, MallocUsage, collection * and epoch flags). This was done to simplify selecting a power of two * size. In the expected use case, an extra two bits per entry should be * neglig

Source from the content-addressed store, hash-verified

361 * documentation for more detail)
362 */
363 uint32_t setup_bytes(size_t bytes)
364 {
365 return setup(bytes/sizeof(Element));
366 }
367
368 /** insert loops at most depth_limit times trying to insert a hash
369 * at various locations in the table via a variant of the Cuckoo Algorithm

Callers 1

InitScriptExecutionCacheFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected