Call registered module API defrag functions */
| 9221 | |
| 9222 | /* Call registered module API defrag functions */ |
| 9223 | long moduleDefragGlobals(void) { |
| 9224 | dictIterator *di = dictGetIterator(modules); |
| 9225 | dictEntry *de; |
| 9226 | long defragged = 0; |
| 9227 | |
| 9228 | while ((de = dictNext(di)) != NULL) { |
| 9229 | struct RedisModule *module = dictGetVal(de); |
| 9230 | if (!module->defrag_cb) |
| 9231 | continue; |
| 9232 | RedisModuleDefragCtx defrag_ctx = { 0, 0, NULL }; |
| 9233 | module->defrag_cb(&defrag_ctx); |
| 9234 | defragged += defrag_ctx.defragged; |
| 9235 | } |
| 9236 | dictReleaseIterator(di); |
| 9237 | |
| 9238 | return defragged; |
| 9239 | } |
| 9240 | |
| 9241 | /* Register all the APIs we export. Keep this function at the end of the |
| 9242 | * file so that's easy to seek it to add new entries. */ |
no test coverage detected