Related articles |
---|
[23 earlier articles] |
Re: Fat references bobduff@shell01.TheWorld.com (Robert A Duff) (2010-01-04) |
Re: Fat references anton@a4.complang.tuwien.ac.at (2010-01-04) |
Re: Fat references kkylheku@gmail.com (Kaz Kylheku) (2010-01-04) |
Re: Fat references jon@ffconsultancy.com (Jon Harrop) (2010-01-05) |
Re: Fat references dmr@bell-labs.com (Dennis Ritchie) (2010-01-05) |
Re: Fat references kkylheku@gmail.com (Kaz Kylheku) (2010-01-05) |
Re: Fat references cr88192@hotmail.com (BGB / cr88192) (2010-01-05) |
Re: Fat references jon@ffconsultancy.com (Jon Harrop) (2010-01-06) |
Re: Fat references jon@ffconsultancy.com (Jon Harrop) (2010-01-06) |
Re: Fat references gneuner2@comcast.net (George Neuner) (2010-01-07) |
Re: Fat references gneuner2@comcast.net (George Neuner) (2010-01-07) |
Re: Fat references gneuner2@comcast.net (George Neuner) (2010-01-07) |
From: | "BGB / cr88192" <cr88192@hotmail.com> |
Newsgroups: | comp.compilers |
Date: | Tue, 5 Jan 2010 16:05:34 -0700 |
Organization: | albasani.net |
References: | 09-12-045 09-12-050 09-12-056 10-01-010 10-01-022 10-01-029 |
Keywords: | storage, VM |
Posted-Date: | 08 Jan 2010 10:16:25 EST |
"Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message
> Jon Harrop <jon@ffconsultancy.com> writes:
>> Memory consumption is only increased for duplicated references
>> (i.e. when two or more references in the heap point to the same value)
>> but I believe that is comparatively rare.
>
> That's a good point.
>
> But don't forget to count 'null' pointers. For example, consider
> a balanced binary tree of depth 3. You've got 7 nodes and
> 7 non-null pointers to them (one from outside the tree).
> But you've also got 8 null pointers stored in the leaf
> nodes. As I understand it, those 8 null pointers are
> going to be 4 words each, in HLVM.
>
> You can think of 'null' as being a pointer to a single
> dummy object -- and there are typically lots of duplicates!
>
<snip>
>
> Anyway, if you've got good measurements, they trump my
> speculation.
yep.
I at first had more than a few doubts, but had later discovered that
the VM was actually a very different technology than I had originally
thought, namely: it is statically typed, ...
so, yeah, 128 or 256 bit references performing well with static typing
is much easier to understand...
the main difference is in how things work:
in static typing, most things are not references;
in dynamic typing, almost everything is references.
I hadn't originally considered this, as I tend to use a large amount of
"mixed typing" instead.
>>...Indeed, a lot of literature on reference counting says that this
>> is so and, hence, 1-bit reference counts that saturate can still be
>> useful.
>
> Yes, I've read that. There are lots of GC schemes that take
> advantage of that.
>
yep.
my guess:
0 not/encodable
1 0
2+ 1
I have typically used more bits 2-4, and allow 0 to be encodable (misc
reasons, mostly so that an operation can do a "safe decrement" and
re-increment without freeing the object, because it makes more sense
to me to allocate an object with count=0 so that putting it into a
variable will make the count=1, ...).
> - Bob
Return to the
comp.compilers page.
Search the
comp.compilers archives again.