| 39 | /* Allocate N bytes of memory dynamically, with error checking. */ |
| 40 | |
| 41 | void * |
| 42 | GnuDiff::xmalloc(size_t n) |
| 43 | { |
| 44 | void *p; |
| 45 | |
| 46 | p = malloc(n == 0 ? 1 : n); // There are systems where malloc returns 0 for n==0. |
| 47 | if(p == nullptr) |
| 48 | xalloc_die(); |
| 49 | return p; |
| 50 | } |
| 51 | |
| 52 | /* Change the size of an allocated block of memory P to N bytes, |
| 53 | with error checking. */ |
nothing calls this directly
no outgoing calls
no test coverage detected