[haiku-development] Re: shared library areas?

  • From: pete.goodeve@xxxxxxxxxxxx
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 9 Aug 2011 11:01:33 -0700

On Tue, Aug 09, 2011 at 04:15:36PM +0200, Oliver Tappe wrote:
> On 2011-08-09 at 04:17:35 [+0200], pete.goodeve@xxxxxxxxxxxx wrote:
> > I'm puzzled.  Why do multiple instances of a library show different
> > addresses (with listarea) in Haiku, when -- as I would expect -- they
> > all have the same address in BeOS?
> 
> What do you mean by 'multiple instances of a library'? Do you mean two 
> different programs using the same library? If so, their address are likely 
> to be different because Haiku will map the library once into the virtual 
> address space of each program (team). The exact address used depends on the 
> size of the program and the set (and order) of libraries it uses.
> In that context, I seriously doubt that BeOS behaved any differently, since 
> it uses a virtual address space for each team, too, just like Haiku.

Yes, I mean the address shown for the library in the area list for
each team.  I gather you are saying that the storage is allocated
once, but mapped differently for each library.

I sort of assumed that must be the case, but in fact BeOS (BONE in my
case -- haven't checked other revs) *does* show exactly the same address
for every use of the same library, so I was puzzled.

<Ingo:>
> BeOS perhaps uses a different algorithm. BONE/Dan0 have a
> kernel-based runtime loader which seems to cache shared objects -- probably
> already relocated, so that assigning the same address is highly advantageous.

Yes, I noticed  'cachedlib...' entries in the list.  Oddly they're the
only ones that show a *different* address!

Thanks,
        -- Pete --


Other related posts: