Thinking about this a bit more, maybe the memory cost could go away with tagged 
pointers.  That is easier to do on a 64-bit platform though.

Eric

On Mar 13, 2014, at 1:37 PM, Eric Summers <eric.summ...@me.com> wrote:

> Yes, but with tags you pay the cost even if Option is None.
> 
> Eric
> 
> On Mar 13, 2014, at 1:33 PM, Daniel Micay <danielmi...@gmail.com> wrote:
> 
>> On 13/03/14 02:25 PM, Eric Summers wrote:
>>> Also this approach uses more memory.  At least a byte per pointer and
>>> maybe more with padding.  In most cases like this you would prefer to
>>> use a vtable instead of tags to reduce the memory footprint.
>>> 
>>> Eric
>> 
>> A vtable uses memory too. Either it uses a fat pointer or adds at least
>> one pointer to the object.
>> 
> 
> _______________________________________________
> Rust-dev mailing list
> Rust-dev@mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to