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

Function defragOtherGlobals

app/redis-6.2.6/src/defrag.c:937–947  ·  view source on GitHub ↗

We may need to defrag other globals, one small allocation can hold a full allocator run. * so although small, it is still important to defrag these */

Source from the content-addressed store, hash-verified

935/* We may need to defrag other globals, one small allocation can hold a full allocator run.
936 * so although small, it is still important to defrag these */
937long defragOtherGlobals() {
938 long defragged = 0;
939
940 /* there are many more pointers to defrag (e.g. client argv, output / aof buffers, etc.
941 * but we assume most of these are short lived, we only need to defrag allocations
942 * that remain static for a long time */
943 defragged += activeDefragSdsDict(server.lua_scripts, DEFRAG_SDS_DICT_VAL_IS_STROB);
944 defragged += activeDefragSdsListAndDict(server.repl_scriptcache_fifo, server.repl_scriptcache_dict, DEFRAG_SDS_DICT_NO_VAL);
945 defragged += moduleDefragGlobals();
946 return defragged;
947}
948
949/* returns 0 more work may or may not be needed (see non-zero cursor),
950 * and 1 if time is up and more work is needed. */

Callers 1

activeDefragCycleFunction · 0.85

Calls 3

activeDefragSdsDictFunction · 0.85
moduleDefragGlobalsFunction · 0.85

Tested by

no test coverage detected