Mercurial > ~dholland > hg > tradcpp > index.cgi
comparison array.c @ 38:b156910b59b2
Wrap free() in dofree() to allow instrumenting it for debugging.
author | David A. Holland |
---|---|
date | Sat, 30 Mar 2013 21:02:25 -0400 (2013-03-31) |
parents | 9c1cecba517c |
children | 337110e7240a |
comparison
equal
deleted
inserted
replaced
37:70902cac4170 | 38:b156910b59b2 |
---|---|
45 | 45 |
46 void | 46 void |
47 array_destroy(struct array *a) | 47 array_destroy(struct array *a) |
48 { | 48 { |
49 array_cleanup(a); | 49 array_cleanup(a); |
50 free(a); | 50 dofree(a); |
51 } | 51 } |
52 | 52 |
53 void | 53 void |
54 array_init(struct array *a) | 54 array_init(struct array *a) |
55 { | 55 { |
59 | 59 |
60 void | 60 void |
61 array_cleanup(struct array *a) | 61 array_cleanup(struct array *a) |
62 { | 62 { |
63 arrayassert(a->num == 0); | 63 arrayassert(a->num == 0); |
64 free(a->v); | 64 dofree(a->v); |
65 #ifdef ARRAYS_CHECKED | 65 #ifdef ARRAYS_CHECKED |
66 a->v = NULL; | 66 a->v = NULL; |
67 #endif | 67 #endif |
68 } | 68 } |
69 | 69 |