From 07f4a9151eda892e391800b5d53d4c50f93feb4e Mon Sep 17 00:00:00 2001 From: Daniel Llorens Date: Thu, 18 Apr 2013 15:12:09 +0200 Subject: [PATCH] Inline generalized-vector calls in array_handle_ref/set * libguile/arrays.c: (array-handle-ref, array-handle-set): Ditto. --- libguile/arrays.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/libguile/arrays.c b/libguile/arrays.c index 98c8075e9..cc62350b8 100644 --- a/libguile/arrays.c +++ b/libguile/arrays.c @@ -817,15 +817,25 @@ scm_i_print_array (SCM array, SCM port, scm_print_state *pstate) } static SCM -array_handle_ref (scm_t_array_handle *h, size_t pos) +array_handle_ref (scm_t_array_handle *hh, size_t pos) { - return scm_c_generalized_vector_ref (SCM_I_ARRAY_V (h->array), pos); + scm_t_array_handle h; + SCM ret; + scm_array_get_handle (SCM_I_ARRAY_V (hh->array), &h); + pos = h.base + h.dims[0].lbnd + pos * h.dims[0].inc; + ret = h.impl->vref (&h, pos); + scm_array_handle_release (&h); + return ret; } static void -array_handle_set (scm_t_array_handle *h, size_t pos, SCM val) +array_handle_set (scm_t_array_handle *hh, size_t pos, SCM val) { - scm_c_generalized_vector_set_x (SCM_I_ARRAY_V (h->array), pos, val); + scm_t_array_handle h; + scm_array_get_handle (SCM_I_ARRAY_V (hh->array), &h); + pos = h.base + h.dims[0].lbnd + pos * h.dims[0].inc; + h.impl->vset (&h, pos, val); + scm_array_handle_release (&h); } /* FIXME: should be handle for vect? maybe not, because of dims */