Re: HAVE_MMAP still necessary ?

* MP <singularita gmail com> schrieb:

> We could have some "get that file into memory" call, that will try to
> use mmap if possible and store pointer to freeing the block (that
> would call munmap, free or some other method depending on how the
> block was acquired)

Exactly :)

The actual fs (and only it) should be responsible for getting the
block into memory and later freeing it again - the clients even
don't have to know that something like mmap exists at all.

Such an interface could be very useful for everyone who just needs
some file area in memory and doesnt want to care about sequential

Let's first try it out libmvfs, once it works fine, we can add it
to mcvfs ...

> But we need to cope with situations, where the file won't fit in RAM
> and won't fit in virtual memory either. For example 8gb file on i386
> architecture with 2 gb of ram.

The vfs call will simply return an appropriate error if there's not 
enough memory available (whether virtual or physical is out the
client's scope).

 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]