OpenCoverage

xmalloc.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/xmalloc.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11enum { HAVE_GNU_CALLOC = 1 };-
12-
13-
14-
15-
16-
17-
18void *-
19xmalloc (size_t n)-
20{-
21 void *p = malloc (n);-
22 if (!p
!pDescription
TRUEnever evaluated
FALSEevaluated 271329 times by 56 tests
Evaluated by:
  • cat
  • chgrp
  • chmod
  • chown
  • cp
  • csplit
  • cut
  • date
  • dd
  • df
  • dir
  • du
  • expr
  • factor
  • ginstall
  • head
  • id
  • join
  • kill
  • ln
  • ls
  • mkdir
  • mktemp
  • mv
  • nl
  • ...
&& n != 0
n != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0-271329
23 xalloc_die ();
never executed: xalloc_die ();
0
24 return
executed 271329 times by 56 tests: return p;
Executed by:
  • cat
  • chgrp
  • chmod
  • chown
  • cp
  • csplit
  • cut
  • date
  • dd
  • df
  • dir
  • du
  • expr
  • factor
  • ginstall
  • head
  • id
  • join
  • kill
  • ln
  • ls
  • mkdir
  • mktemp
  • mv
  • nl
  • ...
p;
executed 271329 times by 56 tests: return p;
Executed by:
  • cat
  • chgrp
  • chmod
  • chown
  • cp
  • csplit
  • cut
  • date
  • dd
  • df
  • dir
  • du
  • expr
  • factor
  • ginstall
  • head
  • id
  • join
  • kill
  • ln
  • ls
  • mkdir
  • mktemp
  • mv
  • nl
  • ...
271329
25}-
26-
27-
28-
29-
30void *-
31xrealloc (void *p, size_t n)-
32{-
33 if (!n
!nDescription
TRUEnever evaluated
FALSEevaluated 11475 times by 45 tests
Evaluated by:
  • chgrp
  • chmod
  • chown
  • comm
  • cp
  • csplit
  • cut
  • date
  • dd
  • df
  • dir
  • du
  • expand
  • factor
  • fold
  • ginstall
  • head
  • join
  • ln
  • ls
  • mv
  • nl
  • numfmt
  • od
  • pinky
  • ...
&& p
pDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-11475
34 {-
35-
36-
37 free (p);-
38 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
39 ((void *)0)
never executed: return ((void *)0) ;
0
40 ;
never executed: return ((void *)0) ;
0
41 }-
42-
43 p = realloc (p, n);-
44 if (!p
!pDescription
TRUEnever evaluated
FALSEevaluated 11475 times by 45 tests
Evaluated by:
  • chgrp
  • chmod
  • chown
  • comm
  • cp
  • csplit
  • cut
  • date
  • dd
  • df
  • dir
  • du
  • expand
  • factor
  • fold
  • ginstall
  • head
  • join
  • ln
  • ls
  • mv
  • nl
  • numfmt
  • od
  • pinky
  • ...
&& n
nDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-11475
45 xalloc_die ();
never executed: xalloc_die ();
0
46 return
executed 11475 times by 45 tests: return p;
Executed by:
  • chgrp
  • chmod
  • chown
  • comm
  • cp
  • csplit
  • cut
  • date
  • dd
  • df
  • dir
  • du
  • expand
  • factor
  • fold
  • ginstall
  • head
  • join
  • ln
  • ls
  • mv
  • nl
  • numfmt
  • od
  • pinky
  • ...
p;
executed 11475 times by 45 tests: return p;
Executed by:
  • chgrp
  • chmod
  • chown
  • comm
  • cp
  • csplit
  • cut
  • date
  • dd
  • df
  • dir
  • du
  • expand
  • factor
  • fold
  • ginstall
  • head
  • join
  • ln
  • ls
  • mv
  • nl
  • numfmt
  • od
  • pinky
  • ...
11475
47}-
48-
49-
50-
51-
52-
53-
54-
55void *-
56x2realloc (void *p, size_t *pn)-
57{-
58 return
executed 2158 times by 8 tests: return x2nrealloc (p, pn, 1);
Executed by:
  • chmod
  • comm
  • du
  • fold
  • join
  • nl
  • pr
  • uniq
x2nrealloc (p, pn, 1);
executed 2158 times by 8 tests: return x2nrealloc (p, pn, 1);
Executed by:
  • chmod
  • comm
  • du
  • fold
  • join
  • nl
  • pr
  • uniq
2158
59}-
60-
61-
62-
63-
64-
65void *-
66xzalloc (size_t s)-
67{-
68 return
executed 385 times by 1 test: return memset (xmalloc (s), 0, s);
Executed by:
  • du
memset (xmalloc (s), 0, s);
executed 385 times by 1 test: return memset (xmalloc (s), 0, s);
Executed by:
  • du
385
69}-
70-
71-
72-
73-
74void *-
75xcalloc (size_t n, size_t s)-
76{-
77 void *p;-
78-
79-
80-
81-
82 if ((
(__builtin_con...oc_count); }))Description
TRUEnever evaluated
FALSEevaluated 9469 times by 6 tests
Evaluated by:
  • du
  • join
  • shuf
  • sort
  • split
  • tr
__builtin_constant_p (n)
__builtin_constant_p (n)Description
TRUEnever evaluated
FALSEevaluated 9469 times by 6 tests
Evaluated by:
  • du
  • join
  • shuf
  • sort
  • split
  • tr
&& __builtin_constant_p (s)
__builtin_constant_p (s)Description
TRUEnever evaluated
FALSEnever evaluated
? ((size_t) (
(__builtin_con...oc_count); }))Description
TRUEnever evaluated
FALSEevaluated 9469 times by 6 tests
Evaluated by:
  • du
  • join
  • shuf
  • sort
  • split
  • tr
0-9469
83 (9223372036854775807L)
(__builtin_con...oc_count); }))Description
TRUEnever evaluated
FALSEevaluated 9469 times by 6 tests
Evaluated by:
  • du
  • join
  • shuf
  • sort
  • split
  • tr
0-9469
84 <
(__builtin_con...oc_count); }))Description
TRUEnever evaluated
FALSEevaluated 9469 times by 6 tests
Evaluated by:
  • du
  • join
  • shuf
  • sort
  • split
  • tr
0-9469
85 (18446744073709551615UL)
(__builtin_con...oc_count); }))Description
TRUEnever evaluated
FALSEevaluated 9469 times by 6 tests
Evaluated by:
  • du
  • join
  • shuf
  • sort
  • split
  • tr
0-9469
86 ?
(__builtin_con...oc_count); }))Description
TRUEnever evaluated
FALSEevaluated 9469 times by 6 tests
Evaluated by:
  • du
  • join
  • shuf
  • sort
  • split
  • tr
0-9469
87 (9223372036854775807L)
(__builtin_con...oc_count); }))Description
TRUEnever evaluated
FALSEevaluated 9469 times by 6 tests
Evaluated by:
  • du
  • join
  • shuf
  • sort
  • split
  • tr
0-9469
88 :
(__builtin_con...oc_count); }))Description
TRUEnever evaluated
FALSEevaluated 9469 times by 6 tests
Evaluated by:
  • du
  • join
  • shuf
  • sort
  • split
  • tr
0-9469
89 (18446744073709551615UL)
(__builtin_con...oc_count); }))Description
TRUEnever evaluated
FALSEevaluated 9469 times by 6 tests
Evaluated by:
  • du
  • join
  • shuf
  • sort
  • split
  • tr
0-9469
90 - 1) / (s) < (n)) : ({ __xalloc_count_type __xalloc_count; __builtin_mul_overflow (n, s, &__xalloc_count); }))
(__builtin_con...oc_count); }))Description
TRUEnever evaluated
FALSEevaluated 9469 times by 6 tests
Evaluated by:
  • du
  • join
  • shuf
  • sort
  • split
  • tr
0-9469
91 || (! (p = calloc (n, s))
! (p = calloc (n, s))Description
TRUEnever evaluated
FALSEevaluated 9469 times by 6 tests
Evaluated by:
  • du
  • join
  • shuf
  • sort
  • split
  • tr
&& (HAVE_GNU_CALLOC
HAVE_GNU_CALLOCDescription
TRUEnever evaluated
FALSEnever evaluated
|| n != 0
n != 0Description
TRUEnever evaluated
FALSEnever evaluated
)))
0-9469
92 xalloc_die ();
never executed: xalloc_die ();
0
93 return
executed 9469 times by 6 tests: return p;
Executed by:
  • du
  • join
  • shuf
  • sort
  • split
  • tr
p;
executed 9469 times by 6 tests: return p;
Executed by:
  • du
  • join
  • shuf
  • sort
  • split
  • tr
9469
94}-
95-
96-
97-
98-
99-
100void *-
101xmemdup (void const *p, size_t s)-
102{-
103 return
executed 102971 times by 28 tests: return memcpy (xmalloc (s), p, s);
Executed by:
  • chgrp
  • chown
  • cp
  • csplit
  • cut
  • df
  • dir
  • du
  • expr
  • ginstall
  • id
  • kill
  • ln
  • ls
  • mktemp
  • mv
  • numfmt
  • paste
  • readlink
  • realpath
  • seq
  • shred
  • sort
  • split
  • stat
  • ...
memcpy (xmalloc (s), p, s);
executed 102971 times by 28 tests: return memcpy (xmalloc (s), p, s);
Executed by:
  • chgrp
  • chown
  • cp
  • csplit
  • cut
  • df
  • dir
  • du
  • expr
  • ginstall
  • id
  • kill
  • ln
  • ls
  • mktemp
  • mv
  • numfmt
  • paste
  • readlink
  • realpath
  • seq
  • shred
  • sort
  • split
  • stat
  • ...
102971
104}-
105-
106-
107-
108char *-
109xstrdup (char const *string)-
110{-
111 return
executed 99504 times by 26 tests: return xmemdup (string, strlen (string) + 1);
Executed by:
  • chgrp
  • chown
  • cp
  • cut
  • df
  • dir
  • du
  • expr
  • ginstall
  • id
  • kill
  • ln
  • ls
  • mktemp
  • mv
  • numfmt
  • paste
  • readlink
  • realpath
  • seq
  • shred
  • split
  • stat
  • timeout
  • tsort
  • ...
xmemdup (string, strlen (string) + 1);
executed 99504 times by 26 tests: return xmemdup (string, strlen (string) + 1);
Executed by:
  • chgrp
  • chown
  • cp
  • cut
  • df
  • dir
  • du
  • expr
  • ginstall
  • id
  • kill
  • ln
  • ls
  • mktemp
  • mv
  • numfmt
  • paste
  • readlink
  • realpath
  • seq
  • shred
  • split
  • stat
  • timeout
  • tsort
  • ...
99504
112}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2