summaryrefslogtreecommitdiffstats
path: root/ta
diff options
context:
space:
mode:
authorBen Boeckel <mathstuf@gmail.com>2015-01-26 13:16:27 -0500
committerwm4 <wm4@nowhere>2015-01-27 18:09:36 +0100
commit2bbad06bfcb189784e7cc5938cfb3a1c7cd9b0cf (patch)
tree89fb086cc8efbc140df8ae6bd8bf180181ba2175 /ta
parentacb40644db08ca7a781583666deffab7beaba10a (diff)
downloadmpv-2bbad06bfcb189784e7cc5938cfb3a1c7cd9b0cf.tar.bz2
mpv-2bbad06bfcb189784e7cc5938cfb3a1c7cd9b0cf.tar.xz
ta: rename MP_TALLOC_ELEMS to MP_TALLOC_AVAIL
The macro actually returns the *available* space in the array, not how much is actually filled in.
Diffstat (limited to 'ta')
-rw-r--r--ta/ta_talloc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/ta/ta_talloc.h b/ta/ta_talloc.h
index 409949495a..1cf99236f4 100644
--- a/ta/ta_talloc.h
+++ b/ta/ta_talloc.h
@@ -75,7 +75,7 @@ char *ta_talloc_asprintf_append_buffer(char *s, const char *fmt, ...) TA_PRF(2,
#define TA_EXPAND_ARGS(...) __VA_ARGS__
-#define MP_TALLOC_ELEMS(p) (talloc_get_size(p) / sizeof((p)[0]))
+#define MP_TALLOC_AVAIL(p) (talloc_get_size(p) / sizeof((p)[0]))
#define MP_RESIZE_ARRAY(ctx, p, count) \
do { \
@@ -86,7 +86,7 @@ char *ta_talloc_asprintf_append_buffer(char *s, const char *fmt, ...) TA_PRF(2,
#define MP_TARRAY_GROW(ctx, p, nextidx) \
do { \
size_t nextidx_ = (nextidx); \
- if (nextidx_ >= MP_TALLOC_ELEMS(p)) \
+ if (nextidx_ >= MP_TALLOC_AVAIL(p)) \
MP_RESIZE_ARRAY(ctx, p, ta_calc_prealloc_elems(nextidx_)); \
} while (0)