[Y-devel] Proposal for a minor change in the Y-protocol
Ben Farrell benfarrell at zoom.co.uk
Mon Apr 12 12:21:40 BST 2004
Richard Hills wrote:
>Hey,
>
>
>>>In the comments in the libYc is written thet the '\0' may be not used in
>>>the future. I go for it. The '\0' is not needed. You should depend to
>>>"member length" field find how big the string is. And null terminated
>>>strings are a bad idea anyway. A very nice article about this topic is the
>>>following: https://www.joelonsoftware.com/articles/fog0000000319.html
>>>
>>>
>
> As far as I understand the \0 isn't needed, but when I was writing that
>part of libYc it was easier at the time to just include it. Neither the
>server nor libYc clients rely on it.
>
>
>
>>4-bytes aligend addresses. There are to reason I do not like it:
>>1) It is ugly :-)
>>2) Most modern RISC processors do not work very happily with
>>
>>
>not-aligned
>
>
>>values. We should try to make serialization - deserialization as fast
>>
>>
>as
>
>
>>possible
>>
>>
>
> I don't really think it's that ugly. And although we want
>deserialization to go fast, I don't think this will have a significant
>effect on speed. If you can point out a protocol which does align
>everything to the nearest 4 bytes for this reason I'd be interested to
>see it.
>
>Richard Hills
>
>
>
If your reading each property in sequence then theres no not to pad out
the data, since you can just handle it one byte at a time, and you don't
need to worry about endianess (is that even a word ?).
However, if you wanted to do something sneaky and overlay a structure
onto the data to read properties out of sequence then you would need to
worry about byte alignment and padding :o)
Ben Farrell
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved