diff options
author | Andy Wingo <wingo@pobox.com> | 2013-02-18 16:38:24 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-02-18 16:38:24 +0100 |
commit | 336c921146957a7416bc1717289a01f1b556ad82 (patch) | |
tree | a06277914da095c42005622e45997d5ae8b3b3a4 /libguile/array-handle.h | |
parent | 18cd9aff9429c99ffae34448507f9b468e20e06f (diff) | |
download | guile-336c921146957a7416bc1717289a01f1b556ad82.tar.gz |
optimize access to arrays of rank 1 or 2
* libguile/array-handle.c (scm_array_handle_pos_1):
(scm_array_handle_pos_2): New functions.
* libguile/generalized-arrays.c (scm_c_array_ref_1, scm_c_array_ref_2):
(scm_c_array_set_1_x, scm_c_array_set_2_x): New functions.
(scm_i_array_ref, scm_i_array_set_x): New subr bindings for array-ref
and array-set! that avoid consing for arrays of rank 1 or 2.
* test-suite/tests/arrays.test ("array-set!"): Fix expected exception
for wrong number of indices.
Diffstat (limited to 'libguile/array-handle.h')
-rw-r--r-- | libguile/array-handle.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libguile/array-handle.h b/libguile/array-handle.h index 0a0b4031b..fa2449dea 100644 --- a/libguile/array-handle.h +++ b/libguile/array-handle.h @@ -114,6 +114,8 @@ typedef struct scm_t_array_handle { SCM_API void scm_array_get_handle (SCM array, scm_t_array_handle *h); SCM_API ssize_t scm_array_handle_pos (scm_t_array_handle *h, SCM indices); +SCM_API ssize_t scm_array_handle_pos_1 (scm_t_array_handle *h, ssize_t idx0); +SCM_API ssize_t scm_array_handle_pos_2 (scm_t_array_handle *h, ssize_t idx0, ssize_t idx1); SCM_API SCM scm_array_handle_element_type (scm_t_array_handle *h); SCM_API void scm_array_handle_release (scm_t_array_handle *h); SCM_API const SCM* scm_array_handle_elements (scm_t_array_handle *h); |