Add "vector" member to scm_t_array_handle
authorAndy Wingo <wingo@pobox.com>
Sat, 8 Feb 2014 21:11:36 +0000 (22:11 +0100)
committerAndy Wingo <wingo@pobox.com>
Sat, 8 Feb 2014 21:11:36 +0000 (22:11 +0100)
* libguile/array-handle.h (scm_t_array_handle): Add "vector" member.
* libguile/array-handle.c (scm_array_get_handle): Initialize the vector
  member.

libguile/array-handle.c
libguile/array-handle.h

index 10cd375..daa1fcb 100644 (file)
@@ -75,6 +75,7 @@ scm_array_get_handle (SCM array, scm_t_array_handle *h)
   h->writable_elements = NULL;
   h->vref = impl->vref;
   h->vset = impl->vset;
+  h->vector = SCM_I_ARRAYP (array) ? SCM_I_ARRAY_V (array) : array;
   impl->get_handle (array, h);
 }
 
index e777d4d..abe617f 100644 (file)
@@ -106,6 +106,9 @@ typedef struct scm_t_array_handle {
   scm_t_array_element_type element_type;
   const void *elements;
   void *writable_elements;
+
+  /* The backing store for the array, and its accessors.  */
+  SCM vector;
   scm_t_array_ref vref;
   scm_t_array_set vset;
 } scm_t_array_handle;