summaryrefslogtreecommitdiffstats
path: root/ta
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
commit60e8a3d404f0640fa5a3f834eae54b4f1fb9127d (patch)
tree1da89a218d0ecf010c67a87cb2f625c4cb18e7d7 /ta
parentAdding upstream version 0.37.0. (diff)
downloadmpv-85641ae1aad608329bed81c5ced87e668b7f629e.tar.xz
mpv-85641ae1aad608329bed81c5ced87e668b7f629e.zip
Adding upstream version 0.38.0.upstream/0.38.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--ta/ta.h23
-rw-r--r--ta/ta_utils.c21
2 files changed, 20 insertions, 24 deletions
diff --git a/ta/ta.h b/ta/ta.h
index 4baac8f..485f38f 100644
--- a/ta/ta.h
+++ b/ta/ta.h
@@ -144,9 +144,26 @@ void *ta_xrealloc_size(void *ta_parent, void *ptr, size_t size);
#define ta_xrealloc_size(...) ta_dbg_set_loc(ta_xrealloc_size(__VA_ARGS__), TA_LOC)
#endif
-void ta_oom_b(bool b);
-char *ta_oom_s(char *s);
-void *ta_oom_p(void *p);
+static inline void *ta_oom_p(void *p)
+{
+ if (!p)
+ abort();
+ return p;
+}
+
+static inline void ta_oom_b(bool b)
+{
+ if (!b)
+ abort();
+}
+
+static inline char *ta_oom_s(char *s)
+{
+ if (!s)
+ abort();
+ return s;
+}
+
// Generic pointer
#define ta_oom_g(ptr) (TA_TYPEOF(ptr))ta_oom_p(ptr)
diff --git a/ta/ta_utils.c b/ta/ta_utils.c
index 6246968..294ad8d 100644
--- a/ta/ta_utils.c
+++ b/ta/ta_utils.c
@@ -265,27 +265,6 @@ bool ta_vasprintf_append_buffer(char **str, const char *fmt, va_list ap)
return ta_vasprintf_append_at(str, size, fmt, ap);
}
-
-void *ta_oom_p(void *p)
-{
- if (!p)
- abort();
- return p;
-}
-
-void ta_oom_b(bool b)
-{
- if (!b)
- abort();
-}
-
-char *ta_oom_s(char *s)
-{
- if (!s)
- abort();
- return s;
-}
-
void *ta_xmemdup(void *ta_parent, void *ptr, size_t size)
{
void *new = ta_memdup(ta_parent, ptr, size);