summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-07-02 12:53:07 -0700
committerJunio C Hamano <gitster@pobox.com>2014-07-02 12:53:07 -0700
commit6f92e5ff3cdc813de8ef5327fd4bad492fb7d6c9 (patch)
treeb234a0801feb54824d81d3f35b8a1620bba0ae75 /git-compat-util.h
parenta02ad882a17b9d45f63ea448391ac5e9f7948222 (diff)
parent745224e04a03e4544c58d5d38d3c54f67100f8eb (diff)
downloadgit-6f92e5ff3cdc813de8ef5327fd4bad492fb7d6c9.tar.gz
Merge branch 'dt/refs-check-refname-component-sse'
Further micro-optimization of a leaf-function. * dt/refs-check-refname-component-sse: refs.c: SSE2 optimizations for check_refname_component
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index b6f03b36dc..96f55547a3 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -685,6 +685,17 @@ void git_qsort(void *base, size_t nmemb, size_t size,
#endif
#endif
+#if defined(__GNUC__) && defined(__x86_64__)
+#include <emmintrin.h>
+/*
+ * This is the system memory page size; it's used so that we can read
+ * outside the bounds of an allocation without segfaulting.
+ */
+#ifndef PAGE_SIZE
+#define PAGE_SIZE 4096
+#endif
+#endif
+
#ifdef UNRELIABLE_FSTAT
#define fstat_is_reliable() 0
#else