Author: mturk Date: Fri Sep 4 17:08:31 2009 New Revision: 811495 URL: http://svn.apache.org/viewvc?rev=811495&view=rev Log: Well it seems we can use SEH on unix. However calling memset and stuff for each poke is overhead. Some smarter thing needs to be made
Modified: commons/sandbox/runtime/trunk/src/main/native/configure commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestMemoryMap.java Modified: commons/sandbox/runtime/trunk/src/main/native/configure URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/configure?rev=811495&r1=811494&r2=811495&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/configure (original) +++ commons/sandbox/runtime/trunk/src/main/native/configure Fri Sep 4 17:08:31 2009 @@ -876,6 +876,7 @@ #define HAVE_DUP3 `have_function dup3` #define HAVE_EPOLL_CREATE1 `have_function epoll_create1` #define HAVE_SIGSETJMP `have_function sigsetjmp` +#define HAVE_SIGACTION `have_function sigaction` #define HAVE_SOCK_CLOEXEC `have_flag_defined SOCK_CLOEXEC` #define HAVE_FILE_CLOEXEC `have_flag_defined O_CLOEXEC` #define HAVE_OFF64_T $have_off64t Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h?rev=811495&r1=811494&r2=811495&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h (original) +++ commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h Fri Sep 4 17:08:31 2009 @@ -71,7 +71,7 @@ #include <setjmp.h> #if HAVE_SIGSETJMP -#define SEH_SETJMP(E) sigsetjmp((E), 0) +#define SEH_SETJMP(E) sigsetjmp((E), 1) #define SEH_DOJUMP(E, V) siglongjmp((E), (V)) #define SEH_JMPBUF sigjmp_buf #else Modified: commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestMemoryMap.java URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestMemoryMap.java?rev=811495&r1=811494&r2=811495&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestMemoryMap.java (original) +++ commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestMemoryMap.java Fri Sep 4 17:08:31 2009 @@ -121,11 +121,18 @@ assertEquals("Class header [1]", (byte)0xFE, (byte)p2.peek(1)); assertEquals("Class header [2]", (byte)0xBA, (byte)p1.peek(2)); assertEquals("Class header [3]", (byte)0xBE, (byte)p2.peek(3)); - try { - p1.poke(0, (byte)0xCA); - } catch (Throwable t) { - System.out.println("Throwed " + t); + Throwable st = null; + int nt = 0; + for (int i = 0; i < 10; i++) { + try { + p1.poke(0, (byte)0xCA); + } catch (Throwable t) { + nt++; + if (st == null) + st = t; + } } + System.out.println("Throwed (" + nt + ") " + st); map.close(); }