Re: Regarding my old mmap patch

"Nuno Lopes" <[email protected]> Mon, 4 Sep 2006 11:37:14 +0100
Newsgroups gmane.comp.web.html-tidy.devel
Message-ID <007201c6d00e$166cdab0$0100a8c0@pc07653>
>> Just a dew thoughts about your patch:
>>
>> I would replace this:
>> +    data->view = MapViewOfFile( data->map, FILE_MAP_READ,
>> +                                (DWORD)( data->pos >> 32 ),
>> +                                (DWORD)data->pos, numb );
>>
>> with a simple:
>> +    data->view = MapViewOfFile( data->map, FILE_MAP_READ, 0, 0, 0);
>>
>> because you already know that pos is zero and that way you don't have to
>> play with the system granularity (thus removing some code you have there 
>> and
>> also reduces the structure size :P).
>>
>> also I don't think you need the pos struct member (it seems pretty 
>> redudant
>> to me).
>
> That would be good until you need to tidy up large files.  I'm sure
> nobody wants tidy taking up huge amounts of address space with no
> discernable performance difference than if it were to read in chunks.


I don't see any problem mapping a 1 GB file. The OS must (and is) be 
intelligent enough to handle such situations.
Also you don't offer any public API to make tidy read a file in chunks, so 
the code you have there is pretty useless (remember the only exported 
function is tidyDocParseFile() ).


Nuno 


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642