httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: [PATCH] Performance improvement for mod_include
Date Fri, 31 Jan 1997 20:57:34 GMT
> Doesn't PHP already do MMAP stuff? PHP has worked on every platform
> I've built Stronghold for so far.. Doesn't seem like it would be too
> much of a hassle.

Yup, mod_php mmap's files.  But, I also use autoconf and have a non-mmap
solution for systems without mmap.  The code is actually trivial.  If there
is no mmap support, I just read the entire file into a buffer manually and
the rest of the code then doesn't have to worry about whether or not the
file came from an mmap or not (until it is time to unmap, of course):

        pa = mmap(NULL, file_size+1, PROT_READ, MAP_PRIVATE, fd, 0);
        pa_pos = 0L;
        FILE *fp;

        fp = fdopen(fd,"r");
        pa = emalloc(0,file_size + 1);
        pa_pos = 0L;

The only platform on which autoconf reports mmap() support where it doesn't
actually work is OSF1.  Here people have to flip off the #define manually.


View raw message