subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsch...@apache.org
Subject svn commit: r1553822 - in /subversion/trunk/subversion/bindings/swig: include/svn_types.swg perl/libsvn_swig_perl/swigutil_pl.c perl/libsvn_swig_perl/swigutil_pl.h
Date Sat, 28 Dec 2013 13:06:51 GMT
Author: rschupp
Date: Sat Dec 28 13:06:50 2013
New Revision: 1553822

URL: http://svn.apache.org/r1553822
Log:
Make bindings helper svn_swig_pl_set_revision() use _global_pool (where available).

* subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h
  (svn_swig_pl_set_revision): Add parameter pool.

* subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c
  (svn_swig_pl_set_revision): Add parameter pool, use it in call to svn_parse_date().
  (convert_pl_revision_range): Pass pool down to svn_swig_pl_set_revision().

* subversion/bindings/swig/include/svn_types.swg
  (%typemap(in) svn_opt_revision_t *): Add local variable _global_pool,
   set it to a global pool when necessary (i.e. when typemap is used
   outside of a wrapped function with a pool parameter) and pass it
   to svn_swig_pl_set_revision().

Modified:
    subversion/trunk/subversion/bindings/swig/include/svn_types.swg
    subversion/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c
    subversion/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h

Modified: subversion/trunk/subversion/bindings/swig/include/svn_types.swg
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/include/svn_types.swg?rev=1553822&r1=1553821&r2=1553822&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/include/svn_types.swg (original)
+++ subversion/trunk/subversion/bindings/swig/include/svn_types.swg Sat Dec 28 13:06:50 2013
@@ -1178,8 +1178,12 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
   useful convertors for svn_opt_revision_t
 */
 #ifdef SWIGPERL
-%typemap(in) svn_opt_revision_t * (svn_opt_revision_t rev) {
-  $1 = svn_swig_pl_set_revision(&rev, $input, TRUE);
+%typemap(in) svn_opt_revision_t * 
+  (svn_opt_revision_t rev, apr_pool_t *_global_pool = NULL)
+{
+  if (_global_pool == NULL)
+    _global_pool = svn_swig_pl_make_pool((SV *)NULL);
+  $1 = svn_swig_pl_set_revision(&rev, $input, TRUE, _global_pool);
 }
 #endif
 

Modified: subversion/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c?rev=1553822&r1=1553821&r2=1553822&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c (original)
+++ subversion/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c Sat Dec
28 13:06:50 2013
@@ -148,11 +148,13 @@ static void *convert_pl_revision_range(S
          * only if croak_on_error is FALSE.
          */
         start = svn_swig_pl_set_revision(&temp_start, 
-                                         *av_fetch(array, 0, 0), croak_on_error);
+                                         *av_fetch(array, 0, 0), 
+                                         croak_on_error, pool);
         if (start == NULL)
             return NULL;
         end = svn_swig_pl_set_revision(&temp_end, 
-                                       *av_fetch(array, 1, 0), croak_on_error);
+                                       *av_fetch(array, 1, 0), 
+                                       croak_on_error, pool);
         if (end == NULL)
             return NULL;
 
@@ -430,7 +432,8 @@ SV *svn_swig_pl_revnums_to_list(const ap
 /* perl -> c svn_opt_revision_t conversion */
 svn_opt_revision_t *svn_swig_pl_set_revision(svn_opt_revision_t *rev, 
                                              SV *source, 
-                                             svn_boolean_t croak_on_error)
+                                             svn_boolean_t croak_on_error,
+                                             apr_pool_t *pool)
 {
 #define maybe_croak(argv) do { if (croak_on_error) croak argv; \
                                else return NULL; } while (0)
@@ -468,8 +471,8 @@ svn_opt_revision_t *svn_swig_pl_set_revi
                 maybe_croak(("unknown opt_revision_t string \"%s\": "
                              "missing closing brace for \"{DATE}\"", input));
             *end = '\0';
-            err = svn_parse_date (&matched, &tm, input + 1, apr_time_now(),
-                                  svn_swig_pl_make_pool ((SV *)NULL));
+            err = svn_parse_date (&matched, &tm, 
+                                  input + 1, apr_time_now(), pool);
             if (err) {
                 svn_error_clear (err);
                 maybe_croak(("unknown opt_revision_t string \"{%s}\": "

Modified: subversion/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h?rev=1553822&r1=1553821&r2=1553822&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h (original)
+++ subversion/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h Sat Dec
28 13:06:50 2013
@@ -110,7 +110,8 @@ SV *svn_swig_pl_revnums_to_list(const ap
 
 svn_opt_revision_t *svn_swig_pl_set_revision(svn_opt_revision_t *rev, 
                                              SV *source,
-                                             svn_boolean_t croak_on_error);
+                                             svn_boolean_t croak_on_error,
+                                             apr_pool_t *pool);
 
 /* thunked log_message receiver function.  */
 svn_error_t * svn_swig_pl_thunk_log_receiver(void *baton,



Mime
View raw message