Hi,
On Mon, May 4, 2009 at 9:36 AM, shire <sh...@php.net> wrote:
> Regarding the ZEND_MMAP_AHEAD issue and the temp. fix that Dmitry put in we
> need to find a solution to that, perhaps I can play with that this week too
> as I think I'm seeing some related issues in my testing of 5.3.  Essentially
> we abuse ZEND_MMAP_AHEAD by adding it to the file size and passing it to the
> mmap call which isn't at all valid and only really works up to PAGESIZE.  We
> could possibly use YYFILL to re-allocate more space as necessary past the
> end of file to fix this.

I was thinking of doing something like that with YYFILL too. However
there is a bunch of pointers to take in to account and to update (e.g.
yy_marker, yy_text, etc).

There is mmap(MAP_FIXED) as an other temporary solution. The idea is
to map the entire file rounded up to a whole page size, and to map the
last (already mapped) page to anonymous memory using MAP_FIXED. In the
end we get a readable contiguous memory region with the file data and
ZEND_MMAP_AHEAD.
This should work on many systems as long as the requested address is
already part of the process's address space (which is always the case
here). When this fails we can fallback to malloc/read.

Regards,

Arnaud

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to