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

Function push_enclosing_class

internal/cbm/lsp/java_lsp.c:321–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319}
320
321static void push_enclosing_class(JavaLSPContext *ctx, const char *class_qn) {
322 if (ctx->enclosing_class_depth >= ctx->enclosing_class_cap) {
323 int new_cap = ctx->enclosing_class_cap == 0 ? 8 : ctx->enclosing_class_cap * 2;
324 const char **arr =
325 (const char **)cbm_arena_alloc(ctx->arena, (size_t)new_cap * sizeof(*arr));
326 if (!arr)
327 return;
328 if (ctx->enclosing_class_depth > 0) {
329 memcpy(arr, ctx->enclosing_class_stack,
330 (size_t)ctx->enclosing_class_depth * sizeof(*arr));
331 }
332 ctx->enclosing_class_stack = arr;
333 ctx->enclosing_class_cap = new_cap;
334 }
335 ctx->enclosing_class_stack[ctx->enclosing_class_depth++] = class_qn;
336}
337
338static void pop_enclosing_class(JavaLSPContext *ctx) {
339 if (ctx->enclosing_class_depth > 0)

Callers 3

java_process_class_declFunction · 0.85

Calls 1

cbm_arena_allocFunction · 0.50

Tested by

no test coverage detected