server/modules/selva/module/edge.c
static struct EdgeField *alloc_EdgeField(const Selva_NodeId src_node_id, const struct EdgeFieldConstraint *constraint, size_t initial_size) {
    struct EdgeField *edgeField;

    edgeField = RedisModule_Calloc(1, sizeof(struct EdgeField));
    if (!edgeField) {
        return NULL;
    }

    edgeField->constraint = constraint;
    memcpy(edgeField->src_node_id, src_node_id, SELVA_NODE_ID_SIZE);
    SVector_Init(&edgeField->arcs, initial_size, SelvaSVectorComparator_Node);

    return edgeField;
}
/**
 * Allocate a new EdgeField struct and initialize it.
 */
Allocate a new EdgeField struct and initialize it.
Allocate a new EdgeField struct and initialize it .
static struct EdgeField *alloc_EdgeField(const Selva_NodeId src_node_id, const struct EdgeFieldConstraint *constraint, size_t initial_size) {
    struct EdgeField *edgeField;
    edgeField = RedisModule_Calloc(1, sizeof(struct EdgeField));
    if (!edgeField) {
        return NULL;
    }
    edgeField->constraint = constraint;
    memcpy(edgeField->src_node_id, src_node_id, SELVA_NODE_ID_SIZE);
    SVector_Init(&edgeField->arcs, initial_size, SelvaSVectorComparator_Node);
    return edgeField;
}
static struct EdgeField * alloc_EdgeField ( const Selva_NodeId src_node_id , const struct EdgeFieldConstraint * constraint , size_t initial_size ) { struct EdgeField * edgeField ; edgeField = RedisModule_Calloc ( 1 , sizeof ( struct EdgeField ) ) ; if ( ! edgeField ) { return NULL ; } edgeField -> constraint = constraint ; memcpy ( edgeField -> src_node_id , src_node_id , SELVA_NODE_ID_SIZE ) ; SVector_Init ( & edgeField -> arcs , initial_size , SelvaSVectorComparator_Node ) ; return edgeField ; }
Allocate a new EdgeField struct and initialize it.
Allocate a new EdgeField struct and initialize it .