Handbook
Glossary
compute-slot-offset ( offset class -- offset' )
Vocabulary
classes
.
struct
.
private
Inputs
offset
an
object
class
an
object
Outputs
offset'
an
object
Definition
IN:
classes.struct.private
GENERIC:
compute-slot-offset
( offset class -- offset' )
Methods
USING:
accessors
classes.struct
classes.struct.private
kernel
math
;
M:
struct-bit-slot-spec
compute-slot-offset
[
offset<<
]
[
bits>>
+
]
2bi
;
USING:
accessors
alien.c-types
classes.struct
classes.struct.private
kernel
math
;
M:
struct-slot-spec
compute-slot-offset
[
over
c-type-align-at
8
*
align
]
keep
[
[
8
/i
]
dip
offset<<
]
[
type>>
heap-size
8
*
+
]
2bi
;