Results 1 to 3 of 3

Thread: new vs QSharedMemory

  1. #1
    Join Date
    Mar 2010
    Posts
    55
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default new vs QSharedMemory

    I need to allocate a chunk of memory for reading and writing data. I notice that Qt has a QSharedMemory class, which seems to do just that. But how efficient is it? How much overhead does it have?

    I wonder if I should use it, or if I should just stick with the new operator?

  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: new vs QSharedMemory

    I don't think QSharedMemory does what you want. It is for sharing a bunch of bytes between different processes. That's something totally different than the new operator.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2010
    Posts
    55
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: new vs QSharedMemory

    Got it, I'll just stick with new, thanks.

Similar Threads

  1. QSharedMemory and C++ objects
    By MattPhillips in forum Qt Programming
    Replies: 7
    Last Post: 29th November 2010, 07:42
  2. QSharedMemory won't attach
    By MattPhillips in forum Qt Programming
    Replies: 3
    Last Post: 27th November 2009, 15:45
  3. QSharedMemory in processes from different accounts
    By Ursa in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2009, 09:50

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.