MCPcopy Create free account
hub / github.com/F-Stack/f-stack / xo_depth_check

Function xo_depth_check

tools/libxo/libxo/libxo.c:528–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

526}
527
528static int
529xo_depth_check (xo_handle_t *xop, int depth)
530{
531 xo_stack_t *xsp;
532
533 if (depth >= xop->xo_stack_size) {
534 depth += XO_DEPTH; /* Extra room */
535
536 xsp = xo_realloc(xop->xo_stack, sizeof(xop->xo_stack[0]) * depth);
537 if (xsp == NULL) {
538 xo_failure(xop, "xo_depth_check: out of memory (%d)", depth);
539 return -1;
540 }
541
542 int count = depth - xop->xo_stack_size;
543
544 bzero(xsp + xop->xo_stack_size, count * sizeof(*xsp));
545 xop->xo_stack_size = depth;
546 xop->xo_stack = xsp;
547 }
548
549 return 0;
550}
551
552void
553xo_no_setlocale (void)

Callers 4

xo_init_handleFunction · 0.85
xo_depth_changeFunction · 0.85
xo_set_depthFunction · 0.85
xo_emit_warn_hcvFunction · 0.85

Calls 2

xo_failureFunction · 0.85
bzeroFunction · 0.85

Tested by

no test coverage detected