-
- if (expected == NULL && ret != 0)
- printf("tk should not complete but completes with <%s>\n", s);
- if (expected != NULL && ret != 0)
- printf("tk should complete with <%s> but completes with <%s>\n",
- expected, s);
-
- ec_completed_tk_free(p);
-
- return ret;
-}
-
-TAILQ_HEAD(debug_alloc_hdr_list, debug_alloc_hdr);
-static struct debug_alloc_hdr_list debug_alloc_hdr_list =
- TAILQ_HEAD_INITIALIZER(debug_alloc_hdr_list);
-
-struct debug_alloc_hdr {
- TAILQ_ENTRY(debug_alloc_hdr) next;
- const char *file;
- unsigned int line;
- size_t size;
- unsigned int cookie;
-};
-
-static void *debug_malloc(size_t size, const char *file, unsigned int line)
-{
- struct debug_alloc_hdr *hdr;
- size_t new_size = size + sizeof(*hdr) + sizeof(unsigned int);
- void *ret;
-
- hdr = malloc(new_size);
- if (hdr == NULL) {
- ret = NULL;