Creating ByteArrays in C primitives

Paul Dufresne dufrp at hotmail.com
Wed Oct 20 04:05:28 PDT 2004


Does the fact that result being declared of type ByteArray pointer,
will make it throw an error if buffer is not word-aligned? (Slate pointers
being 31 bits, they should not be used with pointers with 1 at bit0).

Also, does this have been included in CVS? If so, in which file?

----Original Message Follows----
From: "Lendvai Attila" <Attila.Lendvai at netvisor.hu>
I've got a pidgin function:

oh@(ObjectHeap pointer) newByteArrayFrom: buffer sized: bytes
"Creates a new slate ByteArray object and initializes from the given
buffer."
[| result!(ByteArray pointer) buffer!(Byte pointer) |
   result: (oh newByteArray: ByteArrayProto sized: bytes)!(ByteArray
pointer) cast.
   buffer copyBytes: bytes into: (result elements)!(Byte pointer).
   result
]!(ByteArray pointer) inline export.





More information about the Slate mailing list