aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/make_malloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bmake/make_malloc.h')
-rw-r--r--contrib/bmake/make_malloc.h26
1 files changed, 6 insertions, 20 deletions
diff --git a/contrib/bmake/make_malloc.h b/contrib/bmake/make_malloc.h
index 72f6c11fd882..b1cfe8487837 100644
--- a/contrib/bmake/make_malloc.h
+++ b/contrib/bmake/make_malloc.h
@@ -1,4 +1,4 @@
-/* $NetBSD: make_malloc.h,v 1.16 2021/01/19 20:51:46 rillig Exp $ */
+/* $NetBSD: make_malloc.h,v 1.18 2021/12/15 11:01:39 rillig Exp $ */
/*
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -27,10 +27,10 @@
*/
#ifndef USE_EMALLOC
-void *bmake_malloc(size_t);
-void *bmake_realloc(void *, size_t);
-char *bmake_strdup(const char *);
-char *bmake_strldup(const char *, size_t);
+void *bmake_malloc(size_t) MAKE_ATTR_USE;
+void *bmake_realloc(void *, size_t) MAKE_ATTR_USE;
+char *bmake_strdup(const char *) MAKE_ATTR_USE;
+char *bmake_strldup(const char *, size_t) MAKE_ATTR_USE;
#else
#include <util.h>
#define bmake_malloc(n) emalloc(n)
@@ -39,18 +39,4 @@ char *bmake_strldup(const char *, size_t);
#define bmake_strldup(s, n) estrndup(s, n)
#endif
-char *bmake_strsedup(const char *, const char *);
-
-/*
- * Thin wrapper around free(3) to avoid the extra function call in case
- * p is NULL, to save a few machine instructions.
- *
- * The case of a NULL pointer happens especially often after Var_Value,
- * since only environment variables need to be freed, but not others.
- */
-MAKE_INLINE void
-bmake_free(void *p)
-{
- if (p != NULL)
- free(p);
-}
+char *bmake_strsedup(const char *, const char *) MAKE_ATTR_USE;