The function below segfaults, but works fine with dense lists (my compiler is gcc 7.2.0, OS Windows). Please confirm if you can reproduce this or if I have done something silly.
#include <stdio.h>
#include <string.h>
#include "skiplist.h"
void sanity_test() {
_CSSL_SkipList* slist = createSkipList(9, 5);
for (int i = 0; i < 100000; i += 1000) {
insertElement(slist, i);
}
_CSSL_RangeSearchResult result = searchRange(slist, 500, 2500);
printf("Result = %d", result.count);
printf("First = %d", result.start->key);
printf("Last = %d", result.end->key);
}
Adding every hundredth integer to the skip list produces an incorrect number of matches (0, 20 expected), but does not segfault.