-/* The threshold (in octets) under which bytevectors are stored "in-line",
- 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) \
- SCM_SMOB_PREDICATE (scm_tc16_bytevector, _bv)
-#define SCM_F_BYTEVECTOR_INLINE 0x1
-#define SCM_BYTEVECTOR_INLINE_P(_bv) \
- (SCM_SMOB_FLAGS (_bv) & SCM_F_BYTEVECTOR_INLINE)
+#define SCM_BYTEVECTOR_P(x) \
+ (!SCM_IMP (x) && SCM_TYP7(x) == scm_tc7_bytevector)
+#define SCM_BYTEVECTOR_FLAGS(_bv) \
+ (SCM_CELL_TYPE (_bv) >> 7UL)
+#define SCM_SET_BYTEVECTOR_FLAGS(_bv, _f) \
+ SCM_SET_CELL_TYPE ((_bv), \
+ scm_tc7_bytevector | ((scm_t_bits)(_f) << 7UL))
+
+#define SCM_BYTEVECTOR_ELEMENT_TYPE(_bv) \
+ (SCM_BYTEVECTOR_FLAGS (_bv) & 0xffUL)
+#define SCM_BYTEVECTOR_CONTIGUOUS_P(_bv) \
+ (SCM_BYTEVECTOR_FLAGS (_bv) >> 8UL)