| * Various trivial helper wrappers around standard functions |
| * There's no pack memory to release - but stay close to the Git |
| * version so wrap this away: |
| static inline void release_pack_memory(size_t size __used, int flag __used) |
| char *xstrdup(const char *str) |
| release_pack_memory(strlen(str) + 1, -1); |
| die("Out of memory, strdup failed"); |
| void *xrealloc(void *ptr, size_t size) |
| void *ret = realloc(ptr, size); |
| release_pack_memory(size, -1); |
| ret = realloc(ptr, size); |
| die("Out of memory, realloc failed"); |