MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / updateDictResizePolicy

Function updateDictResizePolicy

src/server.cpp:1708–1713  ·  view source on GitHub ↗

This function is called once a background process of some kind terminates, * as we want to avoid resizing the hash tables when there is a child in order * to play well with copy-on-write (otherwise when a resize happens lots of * memory pages are copied). The goal of this function is to update the ability * for dict.c to resize the hash tables accordingly to the fact we have an * active fork

Source from the content-addressed store, hash-verified

1706 * for dict.c to resize the hash tables accordingly to the fact we have an
1707 * active fork child running. */
1708void updateDictResizePolicy(void) {
1709 if (!hasActiveChildProcess())
1710 dictEnableResize();
1711 else
1712 dictDisableResize();
1713}
1714
1715const char *strChildType(int type) {
1716 switch(type) {

Callers 8

rdbSaveBackgroundForkFunction · 0.85
rdbSaveBackgroundFunction · 0.85
rdbSaveToSlavesSocketsFunction · 0.85
resetChildStateFunction · 0.85
serverCronFunction · 0.85
redisForkFunction · 0.85
RM_ForkFunction · 0.85

Calls 3

hasActiveChildProcessFunction · 0.85
dictEnableResizeFunction · 0.85
dictDisableResizeFunction · 0.85

Tested by

no test coverage detected