Creating ByteArrays in C primitives
Brian Rice
water at tunes.org
Mon Oct 18 08:36:39 PDT 2004
I have no objection.
On Oct 18, 2004, at 1:47 AM, Lendvai Attila wrote:
>
> hi!
>
> 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.
>
> that turns into:
>
> static struct ByteArray * PSObjectHeap_newByteArrayFrom_sized_(struct
> ObjectHeap * oh, Byte * buffer, unsigned long int bytes);
>
> and creates a Slate ByteArray object.
>
> Be warned: In the VM code and in the pidgin doc "ByteArray" is used for
> two things: one is a raw array of bytes in the memory, and one is a
> full-featured Slate ByteArray object. This method created the Slate
> object ByteArray.
>
> water, novo, may I check it in?
>
> - 101
>
>
--
Brian T. Rice
LOGOS Research and Development
http://tunes.org/~water/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1138 bytes
Desc: not available
Url : /archives/slate/attachments/20041018/77100a81/attachment.bin
More information about the Slate
mailing list