This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PCH support on Solaris


Eric Botcazou wrote:

> Right, exactly to the same extent as under Linux I guess. My only goal
> is that the PCH support of Solaris be on par with that of Linux.

Well, I'd still consider your solution for Solaris to be more fragile
than the Linux behaviour.  The difference is that on Linux, the address
hint will be respected *always*, unless impossible (because there are
already overlapping mappings), while on Solaris -to my experience- the
address hint is respected *never*, unless it just so happens to be the
very address where the OS would have decided to place the mapping anyway
(as in your example: note that if you change the program to replace
    if (get_effective_address (preferred, size) != preferred) 
by
    if (get_effective_address (NULL, size) != preferred) 
you still get the 'all clear' output ;-/).

This means under Linux a lot more differences in environment could be
tolerated than under Solaris using your solution.  Plus, if so desired,
you could make the Linux version basically fail-safe by initially (on
PCH creation) choosing a portion of the address space that is far away
from the regions typically used by the OS -- this won't work with the
Solaris version at all.

In any case, I guess the current solution should work well enough for
practical purposes; my only reason for speaking up in this thread
was simply to point out that *if* you need to reimplement the Linux
behaviour of mmap on Solaris, there is a way to do so in a 100%
compatible manner using mincore checks followed by MAP_FIXED.  If
this turns out to be not required, so much the better.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  weigand at informatik dot uni-erlangen dot de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]