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

Function rewriteConfigOOMScoreAdjValuesOption

src/config.cpp:1763–1780  ·  view source on GitHub ↗

Rewrite the oom-score-adj-values option. */

Source from the content-addressed store, hash-verified

1761
1762/* Rewrite the oom-score-adj-values option. */
1763void rewriteConfigOOMScoreAdjValuesOption(struct rewriteConfigState *state) {
1764 int force = 0;
1765 int j;
1766 const char *option = "oom-score-adj-values";
1767 sds line;
1768
1769 line = sdsnew(option);
1770 line = sdscatlen(line, " ", 1);
1771 for (j = 0; j < CONFIG_OOM_COUNT; j++) {
1772 if (g_pserver->oom_score_adj_values[j] != configOOMScoreAdjValuesDefaults[j])
1773 force = 1;
1774
1775 line = sdscatprintf(line, "%d", g_pserver->oom_score_adj_values[j]);
1776 if (j+1 != CONFIG_OOM_COUNT)
1777 line = sdscatlen(line, " ", 1);
1778 }
1779 rewriteConfigRewriteLine(state,option,line,force);
1780}
1781
1782/* Rewrite the bind option. */
1783void rewriteConfigBindOption(struct rewriteConfigState *state) {

Callers 1

rewriteConfigFunction · 0.85

Calls 4

sdsnewFunction · 0.85
sdscatlenFunction · 0.85
sdscatprintfFunction · 0.85
rewriteConfigRewriteLineFunction · 0.85

Tested by

no test coverage detected