Giter Site home page Giter Site logo

fmmap's People

Contributors

pierugit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

yundantianchang

fmmap's Issues

Should the "FMMAP_NOFILE" option be kept?

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.

Windows equivalent of "MAP_NORESERVE" ?

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.

Exposing the fmmap_t type instead of just the C pointer?

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.

Closing the file right after mapping

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

Remove the intrinsic types versions?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.