mirror of
https://github.com/mpv-player/mpv
synced 2024-12-21 06:14:32 +00:00
ta: add TA_FREEP macro
This sets the pointer to NULL after talloc_freeing it. This emulates the av_freep function for ta_talloc, but with a macro instead.
This commit is contained in:
parent
3984d2acca
commit
872d0838a4
@ -73,6 +73,8 @@ char *ta_talloc_asprintf_append_buffer(char *s, const char *fmt, ...) TA_PRF(2,
|
||||
|
||||
// mpv specific stuff - should be made part of proper TA API
|
||||
|
||||
#define TA_FREEP(pctx) do {if (pctx) {talloc_free(*pctx); (*pctx) = NULL;}} while(0)
|
||||
|
||||
#define TA_EXPAND_ARGS(...) __VA_ARGS__
|
||||
|
||||
#define MP_TALLOC_AVAIL(p) (talloc_get_size(p) / sizeof((p)[0]))
|
||||
|
Loading…
Reference in New Issue
Block a user