Hello, I'm finally looking into these new VM ops...
"Andy Wingo" <wi...@pobox.com> writes: > +#define BV_FIXABLE_INT_REF(stem, fn_stem, type, size) \ > +{ \ > + long i; \ > + ARGS2 (bv, idx); \ > + VM_VALIDATE_BYTEVECTOR (bv); \ > + if (SCM_LIKELY (SCM_I_INUMP (idx) \ > + && ((i = SCM_I_INUM (idx)) >= 0) \ > + && (i < SCM_BYTEVECTOR_LENGTH (bv)) \ > + && (i % size == 0))) \ > + RETURN (SCM_I_MAKINUM (*(scm_t_##type*) \ > + (SCM_BYTEVECTOR_CONTENTS (bv) + i))); \ Did you test this on SPARC or some such? I'm 90% sure `(bv-u32-ref bv 1)' would lead to SIGBUS there, due to the unaligned access. This is why `INTEGER_REF ()' in `bytevectors.c' uses memcpy(3). > + else \ > + RETURN (scm_bytevector_##fn_stem##_ref (bv, idx)); \ In this case, we pay the overhead twice (type-checking et al.). Given that there's some duplication with `bytevectors.c', maybe we could share some of the accessor macros between both files? Thanks, Ludo'.