Author: mladen.turk(a)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)
{
Show replies by date