server/modules/selva/module/subscriptions.c
static void destroy_marker(struct Selva_SubscriptionMarker *marker) {
#if 0
    fprintf(stderr, "%s:%d: Destroying marker %p %d %.*s\n",
            __FILE__, __LINE__,
            marker, marker->marker_id,
            (int)SELVA_NODE_ID_SIZE, marker->node_id);
#endif
    rpn_destroy(marker->filter_ctx);
#if MEM_DEBUG
    if (marker->fields) {
        memset(marker->fields, 0, sizeof(*marker->fields));
    }
    memset(marker, 0, sizeof(*marker));
#endif
    if (marker->dir & (SELVA_HIERARCHY_TRAVERSAL_BFS_EXPRESSION |
                       SELVA_HIERARCHY_TRAVERSAL_EXPRESSION)) {
        rpn_destroy_expression(marker->traversal_expression);
    } else {
        RedisModule_Free(marker->ref_field);
    }
    rpn_destroy_expression(marker->filter_expression);
    RedisModule_Free(marker->fields);
    RedisModule_Free(marker);
}
/*
 * Destroy and free a marker.
 */
Destroy and free a marker.
Destroy and free a marker .
static void destroy_marker(struct Selva_SubscriptionMarker *marker) {
#if 0
    fprintf(stderr, "%s:%d: Destroying marker %p %d %.*s\n",
            __FILE__, __LINE__,
            marker, marker->marker_id,
            (int)SELVA_NODE_ID_SIZE, marker->node_id);
#endif
    rpn_destroy(marker->filter_ctx);
#if MEM_DEBUG
    if (marker->fields) {
        memset(marker->fields, 0, sizeof(*marker->fields));
    }
    memset(marker, 0, sizeof(*marker));
#endif
    if (marker->dir & (SELVA_HIERARCHY_TRAVERSAL_BFS_EXPRESSION |
                       SELVA_HIERARCHY_TRAVERSAL_EXPRESSION)) {
        rpn_destroy_expression(marker->traversal_expression);
    } else {
        RedisModule_Free(marker->ref_field);
    }
    rpn_destroy_expression(marker->filter_expression);
    RedisModule_Free(marker->fields);
    RedisModule_Free(marker);
}
static void destroy_marker ( struct Selva_SubscriptionMarker * marker ) { #if 0 fprintf ( stderr , " \n " , __FILE__ , __LINE__ , marker , marker -> marker_id , ( int ) SELVA_NODE_ID_SIZE , marker -> node_id ) ; #endif rpn_destroy ( marker -> filter_ctx ) ; #if MEM_DEBUG if ( marker -> fields ) { memset ( marker -> fields , 0 , sizeof ( * marker -> fields ) ) ; } memset ( marker , 0 , sizeof ( * marker ) ) ; #endif if ( marker -> dir & ( SELVA_HIERARCHY_TRAVERSAL_BFS_EXPRESSION | SELVA_HIERARCHY_TRAVERSAL_EXPRESSION ) ) { rpn_destroy_expression ( marker -> traversal_expression ) ; } else { RedisModule_Free ( marker -> ref_field ) ; } rpn_destroy_expression ( marker -> filter_expression ) ; RedisModule_Free ( marker -> fields ) ; RedisModule_Free ( marker ) ; }
Destroy and free a marker.
Destroy and free a marker .