[jbossnative-commits] JBoss Native SVN: r982 - in trunk/sight/native: share and 1 other directory.

jbossnative-commits at lists.jboss.org jbossnative-commits at lists.jboss.org
Thu Sep 6 09:55:20 EDT 2007


Author: mladen.turk at jboss.com
Date: 2007-09-06 09:55:19 -0400 (Thu, 06 Sep 2007)
New Revision: 982

Modified:
   trunk/sight/native/include/sight_local.h
   trunk/sight/native/share/jnu.c
Log:
Add realloc wrapper

Modified: trunk/sight/native/include/sight_local.h
===================================================================
--- trunk/sight/native/include/sight_local.h	2007-09-06 09:19:25 UTC (rev 981)
+++ trunk/sight/native/include/sight_local.h	2007-09-06 13:55:19 UTC (rev 982)
@@ -143,6 +143,7 @@
 char        *sight_pstrdupj(apr_pool_t *, JNIEnv *, jstring);
 char        *sight_strup(char *);
 void        *sight_malloc(JNIEnv *, apr_size_t, const char *, int);
+void        *sight_realloc(JNIEnv *, void *, apr_size_t, const char *, int);
 void        *sight_calloc(JNIEnv *, apr_size_t, const char *, int);
 void        *sight_palloc(JNIEnv *, apr_pool_t *, apr_size_t,
                           const char *, int);

Modified: trunk/sight/native/share/jnu.c
===================================================================
--- trunk/sight/native/share/jnu.c	2007-09-06 09:19:25 UTC (rev 981)
+++ trunk/sight/native/share/jnu.c	2007-09-06 13:55:19 UTC (rev 982)
@@ -694,6 +694,18 @@
     return p;
 }
 
+void *sight_realloc(JNIEnv *_E, void *oldp, apr_size_t len,
+                    const char *file, int line)
+{
+    void *p;
+    if (!(p = realloc(oldp, len))) {
+        if (_E)
+            throwAprMemoryException(_E, file, line,
+                                    apr_get_os_error());
+    }
+    return p;
+}
+
 char *sight_strdup(JNIEnv *_E, const char *src,
                    const char *file, int line)
 {




More information about the jbossnative-commits mailing list