[M3devel] small objects

hendrik at topoi.pooq.com hendrik at topoi.pooq.com
Thu Apr 9 13:55:39 CEST 2009


On Thu, Apr 09, 2009 at 05:36:49AM +0000, Jay wrote:
> 
> The heap allocation and pressure on the garbage collector -- such a small struct is reasonably efficient to pass around by value.
> 

Generalizing:

So one thing wanted is disjoint unions, like the ones Algol
68 has.  The advantage of this and types with multiple subtypes
is the lack of reference overhead.

This suggests that if I ever get around to data structure
optimisation in my Algol 68 compiler, I should implement
unions between small data types and references to aligned
data by the low-order bit method.

And this provided an implementation technique for compact
pointer/integer punning that works on machines where all
bit patterns are valid object pointers.  (Are there still any
of these around?  The last one I used was a CDC CYBER in
the 70's)

-- hendrik

>  
> 
>  - Jay
> 
>  
> 
> 
> From: hosking at cs.purdue.edu
> To: jay.krell at cornell.edu
> Date: Thu, 9 Apr 2009 14:22:52 +1000
> CC: m3devel at elegosoft.com
> Subject: Re: [M3devel] small objects
> 
> 
> 
> 
> I don't know what you are saving over just allocating:
> 
> 
> NEW(OBJECT i: INTEGER END)
> NEW(OBJECT r: REFANY END)
> 
> 
> Each is only 2 words: one for the object header and the other for the value

>  
> 
>  - Jay



More information about the M3devel mailing list