Old comments about Java

Walter Bright newshound2 at digitalmars.com
Sat Apr 30 12:29:11 PDT 2011


On 4/23/2011 4:43 PM, bearophile wrote:
> First, they impose a full word of overhead on each and every object, just in
> case someone somewhere sometime wants to grab a lock on that object. What,
> you say that you know that nobody outside of your code will ever get a
> pointer to this object, and that you do your locking elsewhere, and you have
> a zillion of these objects so you'd like them to take up as little memory as
> possible? Sorry. You're screwed. [I have not yet understood why D shared this
> Java design choice.]

The extra pointer slot is a handy place for all kinds of things, not just a 
mutex. Currently, it is also used for the "signals and slots" implementation. 
Andrei and I have discussed using it for a ref counting system (though we 
decided against that for other reasons).


More information about the Digitalmars-d mailing list