MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / bucket_push

Function bucket_push

src/simhash/minhash.c:356–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

354}
355
356static 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
370cbm_lsh_index_t *cbm_lsh_new(void) {
371 cbm_lsh_index_t *idx =

Callers 1

cbm_lsh_insertFunction · 0.85

Calls 1

cbm_reallocFunction · 0.85

Tested by

no test coverage detected