inlining
authorJeremy Harris <jgh146exb@wizmail.org>
Thu, 25 Jul 2019 14:34:10 +0000 (15:34 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Thu, 25 Jul 2019 14:34:10 +0000 (15:34 +0100)
src/src/mytypes.h
src/src/readconf.c
src/src/store.c
src/src/store.h

index 84baa9eea310e111c3e00135a6916d05ec7944b4..aaa6e9052b9f134954b437052431e867937cfb5e 100644 (file)
@@ -125,9 +125,19 @@ functions that are called quite often; for other calls to external libraries
 #define Ustrtoul(s,t,b)    strtoul(CCS(s),CSS(t),b)
 #define Uunlink(s)         unlink(CCS(s))
 
-extern BOOL is_tainted(const void *);
 extern void die_tainted(const uschar *, const uschar *, int);
 
+/* Predicate: if an address is in a tainted pool.
+By extension, a variable pointing to this address is tainted.
+*/
+
+static inline BOOL
+is_tainted(const void * p)
+{
+extern void * tainted_base, * tainted_top;
+return p >= tainted_base && p < tainted_top;
+}
+
 static inline uschar * __Ustrcat(uschar * dst, const uschar * src, const char * func, int line)
 {
 #ifndef COMPILE_UTILITY
index 52c64830e5eea5a7d6883b34b081e784dab3abf0..6ed2ea409dad3cb86546f1ff5b37cbb2725f4ba2 100644 (file)
@@ -3337,7 +3337,7 @@ syscalls).  It also assume we're on the relevant pool. */
 if (statbuf.st_size > 8192)
   {
   rmark r = store_mark();
-  store_get((int)statbuf.st_size, FALSE);
+  void * dummy = store_get((int)statbuf.st_size, FALSE);
   store_reset(r);
   }
 
index 7871d0ccce96d9bc9683951d88925bb36ea1a6ee..41ca43d65f71e22f3f07899e6efd82b3010e9584 100644 (file)
@@ -106,8 +106,8 @@ static int yield_length[NPOOLS] = { -1, -1, -1,  -1, -1, -1 };
 a fast is_tainted implementation. We assume the kernel only allocates mmaps using
 one side or the other of data+heap, not both. */
 
-static void * tainted_base = (void *)-1;
-static void * tainted_top = (void *)0;
+void * tainted_base = (void *)-1;
+void * tainted_top = (void *)0;
 
 /* pool_malloc holds the amount of memory used by the store pools; this goes up
 and down as store is reset or released. nonpool_malloc is the total got by
@@ -159,21 +159,6 @@ static void   internal_store_free(void *, const char *, int linenumber);
 
 /******************************************************************************/
 
-/* Predicate: if an address is in a tainted pool.
-By extension, a variable pointing to this address is tainted.
-*/
-
-BOOL
-is_tainted(const void * p)
-{
-BOOL rc = p >= tainted_base && p < tainted_top;
-
-#ifndef COMPILE_UTILITY
-DEBUG(D_memory) if (rc) debug_printf_indent("is_tainted: YES\n");
-#endif
-return rc;
-}
-
 void
 die_tainted(const uschar * msg, const uschar * func, int line)
 {
index 6464e32ed556ab907e48fb157113e85506ad8ce0..52f211ef580149667191bf343bbfbbe96a848fb8 100644 (file)
@@ -53,7 +53,6 @@ tracing information for debugging. */
 /* The real functions */
 typedef void ** rmark;
 
-extern BOOL    is_tainted(const void *);
 extern BOOL    store_extend_3(void *, BOOL, int, int, const char *, int);
 extern void    store_free_3(void *, const char *, int);
 extern void   *store_get_3(int, BOOL, const char *, int)       ALLOC ALLOC_SIZE(1) WARN_UNUSED_RESULT;