| 354 | } |
| 355 | |
| 356 | static void bucket_push(lsh_bucket_t *bucket, int entry_index) { |
| 357 | if (bucket->count >= bucket->cap) { |
| 358 | int new_cap = bucket->cap < BUCKET_INIT_CAP ? BUCKET_INIT_CAP : bucket->cap * GROW_FACTOR; |
| 359 | int *new_items = |
| 360 | cbm_realloc(CBM_MEM_CLASS_SEMANTIC, bucket->items, (size_t)new_cap * sizeof(int)); |
| 361 | if (!new_items) { |
| 362 | return; |
| 363 | } |
| 364 | bucket->items = new_items; |
| 365 | bucket->cap = new_cap; |
| 366 | } |
| 367 | bucket->items[bucket->count++] = entry_index; |
| 368 | } |
| 369 | |
| 370 | cbm_lsh_index_t *cbm_lsh_new(void) { |
| 371 | cbm_lsh_index_t *idx = |
no test coverage detected