| 1055 | /* Cluster helper functions. */ |
| 1056 | |
| 1057 | static clusterNode *createClusterNode(char *ip, int port) { |
| 1058 | clusterNode *node = zmalloc(sizeof(*node)); |
| 1059 | if (!node) return NULL; |
| 1060 | node->ip = ip; |
| 1061 | node->port = port; |
| 1062 | node->name = NULL; |
| 1063 | node->flags = 0; |
| 1064 | node->replicate = NULL; |
| 1065 | node->replicas_count = 0; |
| 1066 | node->slots = zmalloc(CLUSTER_SLOTS * sizeof(int)); |
| 1067 | node->slots_count = 0; |
| 1068 | node->current_slot_index = 0; |
| 1069 | node->updated_slots = NULL; |
| 1070 | node->updated_slots_count = 0; |
| 1071 | node->migrating = NULL; |
| 1072 | node->importing = NULL; |
| 1073 | node->migrating_count = 0; |
| 1074 | node->importing_count = 0; |
| 1075 | node->redis_config = NULL; |
| 1076 | return node; |
| 1077 | } |
| 1078 | |
| 1079 | static void freeClusterNode(clusterNode *node) { |
| 1080 | int i; |
no test coverage detected