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 */
| 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 */ |
| 937 | long 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. */ |
no test coverage detected