[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The relationship between SCM and scm_t_bits.

From: Marius Vollmer
Subject: Re: The relationship between SCM and scm_t_bits.
Date: Mon, 10 May 2004 15:42:40 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

Marius Vollmer <address@hidden> writes:

> Hi,
> I just got confused about our two 'fundamental' types, SCM and
> scm_t_bits.

Ok, so this is what I have done now:

    * Changes to the C interface

    ** SCM_CELL_WORD_LOC has been deprecated.

    Use the new macro SCM_CELL_OBJECT_LOC instead, which return a
    pointer to a SCM, as opposed to a pointer to a scm_t_bits.

    This was done to allow the correct use of pointers into the Scheme
    heap.  Previously, the heap words were of type scm_t_bits and
    local variables and function arguments were of type SCM, making it
    non-standards-conformant to have a pointer that can point to both.

    ** New macros SCM_SMOB_DATA_2, SM_SMOB_DATA_3, etc.

    These macros should be used instead of SCM_CELL_WORD_2/3 to access
    the second and third words of double smobs.  Likewise for

    Also, there is SCM_SMOB_FLAGS and SCM_SET_SMOB_FLAGS that should
    be used to get and set the 16 exra bits in the zeroth word of a

    And finally, there is SCM_SMOB_OBJECT and SCM_SMOB_SET_OBJECT for
    accesing the first immediate word of a smob as a SCM value, and
    there is SCM_SMOB_OBJECT_LOC for getting a pointer to the first
    immediate smob words.  Like wise for SCM_SMOB_OBJECT_2, etc.

I've also updated the smob documentation in the manual.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]