pierugit / fmmap Goto Github PK
View Code? Open in Web Editor NEWMemory Mapped files in Fortran
License: GNU General Public License v3.0
Memory Mapped files in Fortran
License: GNU General Public License v3.0
writing back can be done by the user with more flexibility, so the added value of this feature is not obvious...
I suggest adding the topic memory-mapped-file
in the About section.
The FMMAP_NOFILE
option creates an anonymous mapping: it's just a virtual memory allocation without a specific backing file (the system swap is used if needed).
It's not different from what the intrinsic ALLOCATE()
does, so the question is "should it be kept?", as it's redundant.
I basically introduced it for flexibility: the same code could perform a named or anonymous mapping depending on the needs, by just switching this option.
In the posix case, the mappings are created with the MAP_NORESERVE
flag. As far as I can understand it (but I'm definitely not sure to understand it), it corresponds to a lazy allocation: the pages stay virtual until we touch them.
I'm not sure what is the equivalent in the Windows case. The CreateFileMappingA()
function has the following flags: SEC_COMMIT
and SEC_RESERVE
, but they have apparently an effect for anonymous mappings only.
Posix only at the moment
In the case the intrinsic types versions are removed, it could make sense to expose the (currently) internal type fmmap_t. It would suppress the management of the internal table, and one could have type bound procedure instead of classical ones.
and not only the whole file
Currently the file remains opened until the mapping is destroyed. In principle it could be closed right after the mapping is created, on both posix and Windows (this has to be tested nonetheless).
On the other hand I can't see any obvious drawback to keep the file opened... So not a priority
These versions require a significant maintenance work compared to the C pointer version, for a relatively limited advantage for the user (i.e. the C pointer version is not much more difficult to use, generally just an additional call to c_f_pointer()).
Moreover, selecting which types/kind should be handled is arbitrary and difficult in the absence of any generic programming capabilities.
Therefore I plan removing these versions for the first beta release.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.