src/xh_stack.c

filter: Statementstmt 90.0% 9 / 10 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 83.3% 10 / 12 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« src/xh_buffer.c ↑ Summary src/xh_param.c »
1 #include "xh_config.h"
2 #include "xh_core.h"
3  
4 void
5 56 xh_stack_init(xh_stack_t *st, xh_uint_t nelts, size_t size)
6 {
7 56 ▶ if ((st->elts = malloc(nelts * size)) == NULL) {
Branch: 1 branch
BranchTrueFalseTotal
if ((st->elts = malloc(nelts * size)) == NULL) { 0 56 56
8 0 croak("Memory allocation error");
9 }
10 56 st->size = size;
11 56 st->nelts = nelts;
12 56 st->top = 0;
13 56 }
14  
15 void
16 56 xh_stack_destroy(xh_stack_t *st)
17 {
18 56 free(st->elts);
19 56 }
« src/xh_buffer.c ↑ Summary src/xh_param.c »