Re: HAVE_MMAP still necessary ?

* Enrico Weigelt <weigelt metux de> schrieb:
> Hi folks,
> I really wonder whether the mmap() stuff is still needed at all.
> It doesnt seem to be really used anywhere.

Ups, didn't look hard enough (just scanned the vfs subdir) ;-O

Okay, there're mainly two mmap()-using places: 

a) cmd.c: compare_files() - it uses the mmap() call directly 
   (w/o going over mcvfs), and it seems to work on local files 
   only. wouldn't it make sense to let it run via mcvfs ? 

b) view.c: it tries to mmap() in the file, obviously to let the
   kernel do all the loading. 
   BUT: do we *really* want mmap() here, or just some "get me
   that file into memory"()-call (same in cmd.c) ?
In case we just want to have an faster way for loading files into 
memory (in case it's supported), I suggest some new vfs operation
for that, let's call it "loadFile()" - it returns some FILE_DATA
structure, containing size, buffer ptr and a callback vector for
free'ing. Everyone who wants the whole file (or large blocks) 
just uses this call instead of ugly #ifdef's, and it's up to vfs
to decide what to do behind the scenes.

 Enrico Weigelt    ==   metux IT service -
 Please visit the OpenSource QM Taskforce:
 Patches / Fixes for a lot dozens of packages in dozens of versions:

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]