| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/xmalloc.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||
| 11 | enum { HAVE_GNU_CALLOC = 1 }; | - | ||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||
| 14 | - | |||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||
| 17 | - | |||||||||||||||||||||||||
| 18 | void * | - | ||||||||||||||||||||||||
| 19 | xmalloc (size_t n) | - | ||||||||||||||||||||||||
| 20 | { | - | ||||||||||||||||||||||||
| 21 | void *p = malloc (n); | - | ||||||||||||||||||||||||
| 22 | if (!p
| 0-271329 | ||||||||||||||||||||||||
| 23 | xalloc_die (); never executed: xalloc_die (); | 0 | ||||||||||||||||||||||||
| 24 | return executed 271329 times by 56 tests: p;return p;Executed by:
executed 271329 times by 56 tests: return p;Executed by:
| 271329 | ||||||||||||||||||||||||
| 25 | } | - | ||||||||||||||||||||||||
| 26 | - | |||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||
| 28 | - | |||||||||||||||||||||||||
| 29 | - | |||||||||||||||||||||||||
| 30 | void * | - | ||||||||||||||||||||||||
| 31 | xrealloc (void *p, size_t n) | - | ||||||||||||||||||||||||
| 32 | { | - | ||||||||||||||||||||||||
| 33 | if (!n
| 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
| 0-11475 | ||||||||||||||||||||||||
| 45 | xalloc_die (); never executed: xalloc_die (); | 0 | ||||||||||||||||||||||||
| 46 | return executed 11475 times by 45 tests: p;return p;Executed by:
executed 11475 times by 45 tests: return p;Executed by:
| 11475 | ||||||||||||||||||||||||
| 47 | } | - | ||||||||||||||||||||||||
| 48 | - | |||||||||||||||||||||||||
| 49 | - | |||||||||||||||||||||||||
| 50 | - | |||||||||||||||||||||||||
| 51 | - | |||||||||||||||||||||||||
| 52 | - | |||||||||||||||||||||||||
| 53 | - | |||||||||||||||||||||||||
| 54 | - | |||||||||||||||||||||||||
| 55 | void * | - | ||||||||||||||||||||||||
| 56 | x2realloc (void *p, size_t *pn) | - | ||||||||||||||||||||||||
| 57 | { | - | ||||||||||||||||||||||||
| 58 | return executed 2158 times by 8 tests: x2nrealloc (p, pn, 1);return x2nrealloc (p, pn, 1);Executed by:
executed 2158 times by 8 tests: return x2nrealloc (p, pn, 1);Executed by:
| 2158 | ||||||||||||||||||||||||
| 59 | } | - | ||||||||||||||||||||||||
| 60 | - | |||||||||||||||||||||||||
| 61 | - | |||||||||||||||||||||||||
| 62 | - | |||||||||||||||||||||||||
| 63 | - | |||||||||||||||||||||||||
| 64 | - | |||||||||||||||||||||||||
| 65 | void * | - | ||||||||||||||||||||||||
| 66 | xzalloc (size_t s) | - | ||||||||||||||||||||||||
| 67 | { | - | ||||||||||||||||||||||||
| 68 | return executed 385 times by 1 test: memset (xmalloc (s), 0, s);return memset (xmalloc (s), 0, s);Executed by:
executed 385 times by 1 test: return memset (xmalloc (s), 0, s);Executed by:
| 385 | ||||||||||||||||||||||||
| 69 | } | - | ||||||||||||||||||||||||
| 70 | - | |||||||||||||||||||||||||
| 71 | - | |||||||||||||||||||||||||
| 72 | - | |||||||||||||||||||||||||
| 73 | - | |||||||||||||||||||||||||
| 74 | void * | - | ||||||||||||||||||||||||
| 75 | xcalloc (size_t n, size_t s) | - | ||||||||||||||||||||||||
| 76 | { | - | ||||||||||||||||||||||||
| 77 | void *p; | - | ||||||||||||||||||||||||
| 78 | - | |||||||||||||||||||||||||
| 79 | - | |||||||||||||||||||||||||
| 80 | - | |||||||||||||||||||||||||
| 81 | - | |||||||||||||||||||||||||
| 82 | if ((
| 0-9469 | ||||||||||||||||||||||||
| 83 | (9223372036854775807L)
| 0-9469 | ||||||||||||||||||||||||
| 84 | <
| 0-9469 | ||||||||||||||||||||||||
| 85 | (18446744073709551615UL)
| 0-9469 | ||||||||||||||||||||||||
| 86 | ?
| 0-9469 | ||||||||||||||||||||||||
| 87 | (9223372036854775807L)
| 0-9469 | ||||||||||||||||||||||||
| 88 | :
| 0-9469 | ||||||||||||||||||||||||
| 89 | (18446744073709551615UL)
| 0-9469 | ||||||||||||||||||||||||
| 90 | - 1) / (s) < (n)) : ({ __xalloc_count_type __xalloc_count; __builtin_mul_overflow (n, s, &__xalloc_count); }))
| 0-9469 | ||||||||||||||||||||||||
| 91 | || (! (p = calloc (n, s))
| 0-9469 | ||||||||||||||||||||||||
| 92 | xalloc_die (); never executed: xalloc_die (); | 0 | ||||||||||||||||||||||||
| 93 | return executed 9469 times by 6 tests: p;return p;Executed by:
executed 9469 times by 6 tests: return p;Executed by:
| 9469 | ||||||||||||||||||||||||
| 94 | } | - | ||||||||||||||||||||||||
| 95 | - | |||||||||||||||||||||||||
| 96 | - | |||||||||||||||||||||||||
| 97 | - | |||||||||||||||||||||||||
| 98 | - | |||||||||||||||||||||||||
| 99 | - | |||||||||||||||||||||||||
| 100 | void * | - | ||||||||||||||||||||||||
| 101 | xmemdup (void const *p, size_t s) | - | ||||||||||||||||||||||||
| 102 | { | - | ||||||||||||||||||||||||
| 103 | return executed 102971 times by 28 tests: memcpy (xmalloc (s), p, s);return memcpy (xmalloc (s), p, s);Executed by:
executed 102971 times by 28 tests: return memcpy (xmalloc (s), p, s);Executed by:
| 102971 | ||||||||||||||||||||||||
| 104 | } | - | ||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||
| 106 | - | |||||||||||||||||||||||||
| 107 | - | |||||||||||||||||||||||||
| 108 | char * | - | ||||||||||||||||||||||||
| 109 | xstrdup (char const *string) | - | ||||||||||||||||||||||||
| 110 | { | - | ||||||||||||||||||||||||
| 111 | return executed 99504 times by 26 tests: xmemdup (string, strlen (string) + 1);return xmemdup (string, strlen (string) + 1);Executed by:
executed 99504 times by 26 tests: return xmemdup (string, strlen (string) + 1);Executed by:
| 99504 | ||||||||||||||||||||||||
| 112 | } | - | ||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |