所以我收到了这个错误
invoke-oracle: malloc.c:2451: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
Abort (core dumped)
程序运行此功能时
int bloom_filter(int *filter,const char *word, int num, int hnum){
uint64_t *hash;
printf("Using bloom_filter \n");
hash = (uint64_t *) malloc(hnum*sizeof(uint64_t));
int i,j, count =0;
for (i =0; i < hnum; i++){
hash[i] = hash_by(i,word);
j = hash[i] % num;
if(filter[j]== 1)
count++;
else
filter[j] = 1;
}
if (count == hnum)
return 1;
else
return 0;
}