[master] 957509b3a VRT_fail to be annoted with cold attribute as a codepath to be taken less likely

Nils Goroll nils.goroll at uplex.de
Mon Aug 7 13:18:06 UTC 2023


commit 957509b3ae179e60319e6b9cf49e190cb4bfecbe
Author: David CARLIER <devnexen at gmail.com>
Date:   Mon Oct 31 16:31:37 2022 +0000

    VRT_fail to be annoted with cold attribute as a codepath to be taken less likely

diff --git a/include/vdef.h b/include/vdef.h
index 36e4fa854..2df601119 100644
--- a/include/vdef.h
+++ b/include/vdef.h
@@ -241,6 +241,12 @@ int __llvm_gcov_flush(void);
 #  define v_unused_
 #endif
 
+#if __GNUC_PREREQ__(4, 3) || defined(__clang__)
+#  define v_cold_    __attribute__((cold))
+#else
+#  define v_cold_
+#endif
+
 /* VTIM API overhaul WIP */
 typedef double vtim_mono;
 typedef double vtim_real;
diff --git a/include/vrt.h b/include/vrt.h
index 9dd7f044b..fedc26da7 100644
--- a/include/vrt.h
+++ b/include/vrt.h
@@ -678,7 +678,7 @@ VCL_VOID VRT_SetHdr(VRT_CTX, VCL_HEADER, const char *pfx, VCL_STRANDS);
 VCL_VOID VRT_handling(VRT_CTX, unsigned hand);
 unsigned VRT_handled(VRT_CTX);
 VCL_VOID VRT_trace(VRT_CTX, VCL_BOOL);
-VCL_VOID VRT_fail(VRT_CTX, const char *fmt, ...) v_printflike_(2,3);
+VCL_VOID VRT_fail(VRT_CTX, const char *fmt, ...) v_printflike_(2,3) v_cold_;
 VCL_VOID VRT_hashdata(VRT_CTX, VCL_STRANDS);
 
 VCL_VOID VRT_Rollback(VRT_CTX, VCL_HTTP);


More information about the varnish-commit mailing list