quickjs-oxide-core 0.4.0

The new quickjs-oxide core: 8-byte values, typed arenas and a mark-sweep heap
Documentation
//! BigInt records. Every BigInt is a heap record: an `i64` does not fit the
//! 32-bit payload. This module defines the record and its tracing; the
//! arithmetic is `vm::bigint`'s.

use super::arena::Record;

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct BigIntRecord {
    pub negative: bool,
    /// Magnitude, least significant limb first, no trailing zero limbs.
    pub limbs: Box<[u64]>,
}

impl Record for BigIntRecord {
    fn vacant() -> Self {
        BigIntRecord {
            negative: false,
            limbs: Box::new([]),
        }
    }

    fn extra_bytes(&self) -> usize {
        self.limbs.len() * 8
    }
}