diff options
Diffstat (limited to 'libguile/bytevectors.h')
-rw-r--r-- | libguile/bytevectors.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libguile/bytevectors.h b/libguile/bytevectors.h index cb2726251..e29fe6d11 100644 --- a/libguile/bytevectors.h +++ b/libguile/bytevectors.h @@ -116,17 +116,21 @@ SCM_API SCM scm_utf32_to_string (SCM, SCM); i.e., without allocating memory beside the SMOB itself (a double cell). This optimization is necessary since small bytevectors are expected to be common. */ -#define SCM_BYTEVECTOR_P(_bv) \ +#define SCM_BYTEVECTOR_P(_bv) \ SCM_SMOB_PREDICATE (scm_tc16_bytevector, _bv) -#define SCM_BYTEVECTOR_INLINE_THRESHOLD (2 * sizeof (SCM)) -#define SCM_BYTEVECTOR_INLINEABLE_SIZE_P(_size) \ - ((_size) <= SCM_BYTEVECTOR_INLINE_THRESHOLD) -#define SCM_BYTEVECTOR_INLINE_P(_bv) \ - (SCM_BYTEVECTOR_INLINEABLE_SIZE_P (SCM_BYTEVECTOR_LENGTH (_bv))) +#define SCM_F_BYTEVECTOR_INLINE 0x1 +#define SCM_BYTEVECTOR_INLINE_P(_bv) \ + (SCM_SMOB_FLAGS (_bv) & SCM_F_BYTEVECTOR_INLINE) +#define SCM_BYTEVECTOR_ELEMENT_TYPE(_bv) \ + (SCM_SMOB_FLAGS (_bv) >> 8) /* Hint that is passed to `scm_gc_malloc ()' and friends. */ #define SCM_GC_BYTEVECTOR "bytevector" +SCM_INTERNAL SCM scm_i_make_typed_bytevector (size_t, scm_t_array_element_type); +SCM_INTERNAL SCM scm_c_take_typed_bytevector (signed char *, size_t, + scm_t_array_element_type); + SCM_INTERNAL void scm_bootstrap_bytevectors (void); SCM_INTERNAL void scm_init_bytevectors (void); |