but you do a lot of useless copy on stack.
R�mi
Yes thats right, bit imagine you deal with a lot of data maybe 200
Vector3 objects. You get quite a lot of memory useage just because of
the references for each of the object. Also (at least in the .net c#
implementation) you can use it to reduce garbage collection calls.
On 2 Apr., 20:16, Seth Ladd <sethl...@google.com> wrote:
> Hi Jako,
>
> Nothing is ruled out forever, but right now Dart is being designed to be
> familiar with Java and JavaScript developers. Neither of those languages
> have a formal struct. Also, Dart classes can be defined quite easily:
>
> class Person {
> String firstName;
> String lastName;
> Date dob;
>
> }
>
> And the fields will have getters and setters:
>
> Person bob = new Person();
> bob.firstName = 'Bob';
> bob.lastName = 'Dartsmith';
>
> Also, I should mention that Dart ships with JSON libraries, which help you
> serialize and deserialize rich data structures like maps and lists.
>
> Might I ask what use cases you have in mind for formal struct in Dart?
>
> Thanks,
> Seth
>
>
>
>
>
>
>
> On Mon, Apr 2, 2012 at 11:11 AM, jako <p4j...@googlemail.com> wrote:
> > I couldn't find anything about this topic so... why are there no
> > structs in dart... or plans to add them?
Naively this would even be true for integers, but the VM uses pointer-tagging to allow a specific range (usually 31 or 63bits) to stay unboxed. (We call these numbers Smis for "Small Integers".)
Naively this would even be true for integers, but the VM uses pointer-tagging to allow a specific range (usually 31 or 63bits) to stay unboxed. (We call these numbers Smis for "Small Integers".)Doesn't the tag actually take 2 bits? At least looking at the declaration of class Smi in runtime/vm/object.h, it seems to be that case. That gives you 4 possible tags, one needs to be used for heap-allocated objects and one is for Smis. The remaining two remain unused?
LT