public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in dev-libs/libpcre/files: libpcre-8.31-madvise.patch
@ 2012-07-12 11:05 Fabian Groffen (grobian)
  0 siblings, 0 replies; only message in thread
From: Fabian Groffen (grobian) @ 2012-07-12 11:05 UTC (permalink / raw
  To: gentoo-commits

grobian     12/07/12 11:05:15

  Added:                libpcre-8.31-madvise.patch
  Log:
  Fix compilation on platforms lacking posix_madvise, using a partial patch grabbed from upstream.
  
  (Portage version: 2.2.01.20757-prefix/cvs/SunOS i386)

Revision  Changes    Path
1.1                  dev-libs/libpcre/files/libpcre-8.31-madvise.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libpcre/files/libpcre-8.31-madvise.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libpcre/files/libpcre-8.31-madvise.patch?rev=1.1&content-type=text/plain

Index: libpcre-8.31-madvise.patch
===================================================================
Partial patch by upstream to fix compilation on platforms without
posix_madvise.

http://vcs.pcre.org/viewvc/code/trunk/sljit/sljitUtils.c?r1=952&r2=987&pathrev=987O

--- code/trunk/sljit/sljitUtils.c	2012/03/16 12:59:30	952
+++ code/trunk/sljit/sljitUtils.c	2012/07/07 04:11:29	987
@@ -106,7 +106,7 @@
 
 #else /* _WIN32 */
 
-#include "pthread.h"
+#include <pthread.h>
 
 #if (defined SLJIT_EXECUTABLE_ALLOCATOR && SLJIT_EXECUTABLE_ALLOCATOR)
 
@@ -262,8 +262,14 @@
 	}
 	aligned_new_limit = (new_limit + sljit_page_align) & ~sljit_page_align;
 	aligned_old_limit = (stack->limit + sljit_page_align) & ~sljit_page_align;
+	/* If madvise is available, we release the unnecessary space. */
+#if defined(POSIX_MADV_DONTNEED)
 	if (aligned_new_limit < aligned_old_limit)
 		posix_madvise((void*)aligned_new_limit, aligned_old_limit - aligned_new_limit, POSIX_MADV_DONTNEED);
+#elif defined(MADV_DONTNEED)
+	if (aligned_new_limit < aligned_old_limit)
+		madvise((void*)aligned_new_limit, aligned_old_limit - aligned_new_limit, MADV_DONTNEED);
+#endif
 	stack->limit = new_limit;
 	return 0;
 #endif






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-12 11:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-12 11:05 [gentoo-commits] gentoo-x86 commit in dev-libs/libpcre/files: libpcre-8.31-madvise.patch Fabian Groffen (grobian)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox