MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rewriteConfigOOMScoreAdjValuesOption

Function rewriteConfigOOMScoreAdjValuesOption

app/redis-6.2.6/src/config.c:1504–1521  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1502
1503/* Rewrite the oom-score-adj-values option. */
1504void rewriteConfigOOMScoreAdjValuesOption(struct rewriteConfigState *state) {
1505 int force = 0;
1506 int j;
1507 char *option = "oom-score-adj-values";
1508 sds line;
1509
1510 line = sdsnew(option);
1511 line = sdscatlen(line, " ", 1);
1512 for (j = 0; j < CONFIG_OOM_COUNT; j++) {
1513 if (server.oom_score_adj_values[j] != configOOMScoreAdjValuesDefaults[j])
1514 force = 1;
1515
1516 line = sdscatprintf(line, "%d", server.oom_score_adj_values[j]);
1517 if (j+1 != CONFIG_OOM_COUNT)
1518 line = sdscatlen(line, " ", 1);
1519 }
1520 rewriteConfigRewriteLine(state,option,line,force);
1521}
1522
1523/* Rewrite the bind option. */
1524void 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