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

Function cx_build_bigpkg

tests/test_complexity.c:316–343  ·  view source on GitHub ↗

Corpus shape #2 — the growing shared package. Real monorepos concentrate * files in a few large packages (org. .common, …), and the JVM filter * branch includes every def sharing the file's namespace — so per-file work * tracks PACKAGE size. A package whose file count scales with the corpus is * therefore the honest reproducer for the #1669 growth pattern that fully * independent modules

Source from the content-addressed store, hash-verified

314 * be linear in k, while a namespace/module-scoped per-file registry build
315 * goes quadratic. */
316static int cx_build_bigpkg(const char *root, int k) {
317 char dir[1024];
318 char path[1200];
319 snprintf(dir, sizeof(dir), "%s/bigsrc/bigpkg", root);
320 if (th_mkdir_p(dir) != 0) {
321 return -1;
322 }
323 int files = k * CX_BIGPKG_FILES_PER_K;
324 for (int j = 0; j < files; j++) {
325 snprintf(path, sizeof(path), "%s/B%d.java", dir, j);
326 FILE *f = fopen(path, "w");
327 if (!f) {
328 return -1;
329 }
330 fprintf(f, "package bigpkg;\n\npublic class B%d {\n", j);
331 fprintf(f, " public int val%d(int x) {\n return x + %d;\n }\n", j, j);
332 if (j > 0) {
333 fprintf(f, " public int chain() {\n");
334 fprintf(f, " B%d prev = new B%d();\n", j - 1, j - 1);
335 fprintf(f, " return prev.val%d(1) + val%d(2);\n }\n", j - 1, j);
336 } else {
337 fprintf(f, " public int chain() {\n return val0(2);\n }\n");
338 }
339 fprintf(f, "}\n");
340 fclose(f);
341 }
342 return 0;
343}
344
345/* Every file probes absent external submodules and retains a real local-call
346 * control. Independent module copies grow the shared registry without adding

Callers

nothing calls this directly

Calls 2

th_mkdir_pFunction · 0.85
fopenFunction · 0.85

Tested by

no test coverage detected