Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed2008-12-15 15:16:59 +0000
committerGrant Gayed2008-12-15 15:16:59 +0000
commit4188b1be69016f9bb3d92f3cf5559219404b5e55 (patch)
tree3e39ff4f8074a01594400244fb6e3a37294fc590
parentb38d7a13d05621c13d4020a1534e72b6dcee1713 (diff)
downloadeclipse.platform.swt-4188b1be69016f9bb3d92f3cf5559219404b5e55.tar.gz
eclipse.platform.swt-4188b1be69016f9bb3d92f3cf5559219404b5e55.tar.xz
eclipse.platform.swt-4188b1be69016f9bb3d92f3cf5559219404b5e55.zip
258309 - [64][Browser] Browser crashes on Snippet307
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java29
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIMemory.java8
6 files changed, 66 insertions, 6 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp
index 911a9882d2..a378162b6c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp
@@ -5245,6 +5245,32 @@ JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsID_1new)
}
#endif
+#ifndef NO__1nsIMemory_1Alloc
+extern "C" JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIMemory_1Alloc)(JNIEnv *env, jclass that, jintLong arg0, jint arg1);
+JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIMemory_1Alloc)
+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1)
+{
+ jintLong rc = 0;
+ XPCOM_NATIVE_ENTER(env, that, _1nsIMemory_1Alloc_FUNC);
+ rc = (jintLong)((nsIMemory *)arg0)->Alloc((size_t)arg1);
+ XPCOM_NATIVE_EXIT(env, that, _1nsIMemory_1Alloc_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO__1nsIMemory_1Realloc
+extern "C" JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIMemory_1Realloc)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2);
+JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIMemory_1Realloc)
+ (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2)
+{
+ jintLong rc = 0;
+ XPCOM_NATIVE_ENTER(env, that, _1nsIMemory_1Realloc_FUNC);
+ rc = (jintLong)((nsIMemory *)arg0)->Realloc((void *)arg1, (size_t)arg2);
+ XPCOM_NATIVE_EXIT(env, that, _1nsIMemory_1Realloc_FUNC);
+ return rc;
+}
+#endif
+
#if (!defined(NO_memmove__ILorg_eclipse_swt_internal_mozilla_nsID_2I) && !defined(JNI64)) || (!defined(NO_memmove__JLorg_eclipse_swt_internal_mozilla_nsID_2I) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT void JNICALL XPCOM_NATIVE(memmove__ILorg_eclipse_swt_internal_mozilla_nsID_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jint arg2);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h
index 130cb55747..f607df1dac 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h
@@ -18,6 +18,7 @@
#include "nsXPCOM.h"
#include "nsEmbedString.h"
#include "nsIInputStream.h"
+#include "nsIMemory.h"
#include "nsISupportsUtils.h"
#include "nsXPCOMGlue.h"
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp
index 5ecb2c8587..eba049945d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp
@@ -14,8 +14,8 @@
#ifdef NATIVE_STATS
-int XPCOM_nativeFunctionCount = 178;
-int XPCOM_nativeFunctionCallCount[178];
+int XPCOM_nativeFunctionCount = 180;
+int XPCOM_nativeFunctionCallCount[180];
char * XPCOM_nativeFunctionNames[] = {
"_1Call",
"_1NS_1GetComponentManager",
@@ -812,6 +812,8 @@ char * XPCOM_nativeFunctionNames[] = {
"_1nsID_1Equals",
"_1nsID_1delete",
"_1nsID_1new",
+ "_1nsIMemory_1Alloc",
+ "_1nsIMemory_1Realloc",
#ifndef JNI64
"memmove__ILorg_eclipse_swt_internal_mozilla_nsID_2I",
#else
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h
index af1689973e..8b7a983cb6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h
@@ -820,6 +820,8 @@ typedef enum {
_1nsID_1Equals_FUNC,
_1nsID_1delete_FUNC,
_1nsID_1new_FUNC,
+ _1nsIMemory_1Alloc_FUNC,
+ _1nsIMemory_1Realloc_FUNC,
#ifndef JNI64
memmove__ILorg_eclipse_swt_internal_mozilla_nsID_2I_FUNC,
#else
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java
index 0514a3301b..6e6871cc97 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java
@@ -364,6 +364,35 @@ public static final int /*long*/ nsEmbedString_get(int /*long*/ ptr) {
lock.unlock();
}
}
+/**
+ * @method flags=cpp
+ * @param ptr cast=(nsIMemory *)
+ * @param size cast=(size_t)
+ */
+public static final native int /*long*/ _nsIMemory_Alloc(int /*long*/ ptr, int size);
+public static final int /*long*/ nsIMemory_Alloc(int /*long*/ ptr, int size) {
+ lock.lock();
+ try {
+ return _nsIMemory_Alloc(ptr, size);
+ } finally {
+ lock.unlock();
+ }
+}
+/**
+ * @method flags=cpp
+ * @param ptr1 cast=(nsIMemory *)
+ * @param ptr2 cast=(void *)
+ * @param size cast=(size_t)
+ */
+public static final native int /*long*/ _nsIMemory_Realloc(int /*long*/ ptr1, int /*long*/ ptr2, int size);
+public static final int /*long*/ nsIMemory_Realloc(int /*long*/ ptr1, int /*long*/ ptr2, int size) {
+ lock.lock();
+ try {
+ return _nsIMemory_Realloc(ptr1, ptr2, size);
+ } finally {
+ lock.unlock();
+ }
+}
/** @param place cast=(const char *) */
public static final native int _XPCOMGlueStartup(byte[] place);
public static final int XPCOMGlueStartup(byte[] place) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIMemory.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIMemory.java
index c4a138346e..641777edbd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIMemory.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIMemory.java
@@ -41,12 +41,12 @@ public class nsIMemory extends nsISupports {
super(address);
}
- public int Alloc(int size) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), size);
+ public int /*long*/ Alloc(int size) {
+ return XPCOM.nsIMemory_Alloc(getAddress(), size);
}
- public int Realloc(int /*long*/ ptr, int newSize) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), ptr, newSize);
+ public int /*long*/ Realloc(int /*long*/ ptr, int newSize) {
+ return XPCOM.nsIMemory_Realloc(getAddress(), ptr, newSize);
}
public int Free(int /*long*/ ptr) {

Back to the top