Results 1 to 9 of 9

Thread: Support for File Mapped Memory?

  1. #1
    Join Date
    Feb 2007
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Support for File Mapped Memory?

    I just started using Qt 4.2 this week because I was finally able to convince my boss that Qt was a far superior framework than what we were using.

    I'm trying to figure out the "Qt way" of implementing File Mapped Memory (MapViewOfFile on win32 and mmap I believe on linux). I've spent hours digging through the documentation and I've found classes for almost everything possible except for this.

    Its pretty integral to our application so I'm hoping that this wasn't a major oversight on my part, but I just can't believe that this functionality wouldn't be available considering all of the other stuff that IS in there coupled with the fact that file mapped memory is becoming so integral to a lot of applications these days.

    Thanks in advance for any responses.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Support for File Mapped Memory?


  3. #3
    Join Date
    Feb 2007
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Support for File Mapped Memory?

    Well based on that link I guess Qt doesn't implement this....I find it a bit peculiar.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Support for File Mapped Memory?

    Quote Originally Posted by Jachyra View Post
    I find it a bit peculiar.
    Really? Why so?

  5. #5
    Join Date
    Feb 2007
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Support for File Mapped Memory?

    Well, just because there are classes in Qt for almost everything else imaginable, coupled with the fact that over the last year a lot of the various Microsoft developer bulletins that we get via our MSDN subscription has really sort of pushed memory maps as the best or "proper" way to implement projects that have very large data files.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Support for File Mapped Memory?

    Qt is a platform independent library and I think that in this particular situation memory mapping is different on different platforms, so it'd be a bit hard to provide a solution that work on all platforms in a simmilar way. Remember that someone has to write all the routines and there are surely more urgent things to do than to provide portable memory mappings.

    Qt doesn't have to do everything, you can always use platform dependent solutions.

  7. #7
    Join Date
    Feb 2007
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Support for File Mapped Memory?

    Well I appreciate the response but I'm not sure I really agree.

  8. #8
    Join Date
    Feb 2007
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Support for File Mapped Memory?

    Ok, so it sounds like my only option then is to just write my own class to handle this. It looks like I can borrow some code from the link that was provided to implement it on linux, and I already know how to do it in win32. Assuming that I can get it working on linux, is it safe to assume that the same code will also work on Mac OS/X (Darwin), or am I going to have to go digging around in the Carbon API? For that matter, is Mac really even separate platform anymore or is it just linux with a proprietary window manager?

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Support for File Mapped Memory?

    It's not safe to assume anything - I didn't even compile the code. In theory it should run but I give no warranty. mmap() is POSIX compliant, so it should work on all POSIX systems (notice the should word in both cases).

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.