Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43831 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43935 invoked from network); 4 May 2009 11:40:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 May 2009 11:40:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=arnaud.lb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=arnaud.lb@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.220 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: arnaud.lb@gmail.com X-Host-Fingerprint: 209.85.220.220 mail-fx0-f220.google.com Received: from [209.85.220.220] ([209.85.220.220:41395] helo=mail-fx0-f220.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 48/67-23981-144DEF94 for ; Mon, 04 May 2009 07:40:50 -0400 Received: by fxm20 with SMTP id 20so3755574fxm.23 for ; Mon, 04 May 2009 04:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:reply-to:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=bhEObo103l6gq8HUJlMTuddbxz4pG+c4tOv9oXuwtzE=; b=UFrVkqklZCxa/b8RDVhXgoKQlKWby3RzpF4cY25MzuvRPjW7dH6ZVSsQqz3ep0+J1N DHkyZk8mLMYUD09vptSWjT48xBP5boPulbC5Uc/GDvdtRV0ndFxopxYaPgg3XlMjETGh 2p8pmEpI3namhdfhIHC+xpOc/PUoleebHTdmw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=hRmcRcbGmMe5cIOThRAG8vOxc3JiXEzGzzwyUzkk78boq46f9QpgDrktYB2h/rbnY7 JChq+mrXNt0kUArbT6Jy0oDh/yvl7fn114MmQIw84emNEZTy0hEGnX/vVRTmWIUuafjU PXSPT6Fh+hm4eqaQfDBctkDEmsEOxeYnOsvZI= MIME-Version: 1.0 Sender: arnaud.lb@gmail.com Reply-To: lbarnaud@php.net Received: by 10.103.115.12 with SMTP id s12mr3508195mum.89.1241437246850; Mon, 04 May 2009 04:40:46 -0700 (PDT) In-Reply-To: <49FE9AE7.4000008@php.net> References: <6604D94D40FD465F992144110B075BB5@pc1> <9D5D4CBF-5CB1-47EC-81F4-59E3C48EEEEF@pooteeweet.org> <49FE9AE7.4000008@php.net> Date: Mon, 4 May 2009 13:40:46 +0200 X-Google-Sender-Auth: 3f18a6755a98c768 Message-ID: To: shire@php.net Cc: Matt Wilmas , internals@lists.php.net, Nuno Lopes , Lukas Kahwe Smith , Dmitry Stogov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [PATCH] Scanner "diet" with fixes, etc. From: lbarnaud@php.net (Arnaud Le Blanc) Hi, On Mon, May 4, 2009 at 9:36 AM, shire 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 t= oo > as I think I'm seeing some related issues in my testing of 5.3. =C2=A0Ess= entially > 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. = =C2=A0We > 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