[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r16722 - trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby

From: David James <james82_at_gmail.com>
Date: 2005-10-15 06:07:15 CEST

On 10/14/05, kou@tigris.org <kou@tigris.org> wrote:
> Duplicate an object passed to callback for avoiding segmentation fault.
>
> * subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
> (DEFINE_DUP_BASE, DEFINE_DUP, DEFINE_DUP2, DEFINE_DUP_NO_CONST,
> DEFINE_DUP_NO_CONST2): New macro to define a duplicate function.
> (delta_editor_window_handler,
> svn_swig_rb_notify_func2,
> svn_swig_rb_info_receiver,
> svn_swig_rb_txdelta_window_handler,
> svn_swig_rb_ra_lock_callback,
> svn_swig_rb_auth_ssl_server_trust_prompt_func,
> wc_entry_callbacks_found_entry): Duplicate an object passed to
> callback.
Very nice work, Kouhei! I have a few comments:

1. The following definitions still use c2r_swig_type, and therefore do
not duplicate their provided objects. Can we fix these?

DEFINE_APR_ARRAY_TO_ARRAY(static VALUE, c2r_commit_item_array,
                          c2r_swig_type, &, svn_client_commit_item_t,
                          (void *)"svn_client_commit_item_t *")
DEFINE_APR_ARRAY_TO_ARRAY(VALUE, svn_swig_rb_apr_array_to_array_prop,
                          c2r_swig_type, &, svn_prop_t,
                          (void *)"svn_prop_t *")
DEFINE_APR_ARRAY_TO_ARRAY(VALUE, svn_swig_rb_apr_array_to_array_proplist_item,
                          c2r_swig_type, , svn_client_proplist_item_t *,
                          (void *)"svn_client_proplist_item_t *")
DEFINE_APR_ARRAY_TO_ARRAY(VALUE, svn_swig_rb_apr_array_to_array_external_item,
                          c2r_swig_type, , svn_wc_external_item_t *,
                          (void *)"svn_wc_external_item_t *")

2. The following functions use svn_swig_apr_hash_to_hash_swig_type,
which does not duplicate provided objects. Can we fix this?
     svn_swig_rb_repos_file_rev_handler
     svn_swig_rb_ra_file_rev_handler

3. Can we prefix the new "dup" functions with "c2r", to clarify that
they convert C->Ruby, and make "dup" a suffix instead of a prefix?
    E.g. Instead of dup_lock, call the function c2r_lock_dup.

Cheers,

David

--
David James -- http://www.cs.toronto.edu/~james
Received on Sat Oct 15 06:08:06 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.