Status & Roadmap
Authors & License
Funding Ultimate++
Search on this site
Search in forums

SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Memory Mapped Files
Memory Mapped Files [message #39808] Thu, 02 May 2013 09:38 Go to next message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member

I'm building a program where I need to write data from a list/vector to the memory with very high I/O performance, because it has to be very fast. In this case you have to be thinking of around ~1 GB of raw data.

I have been looking at memory mapped files. I think this is a very good solution for me. What I looked for first after I got it to know though, was looking for a solution embedded in U++. I couldn't find one. Is there a solution for using memory mapped files? Or do you guys/girls maybe have another solution then memory mapped files that I should have a look at?

Thanks in advance!
Re: Memory Mapped Files [message #39811 is a reply to message #39808] Thu, 02 May 2013 20:30 Go to previous messageGo to next message
BioBytes is currently offline  BioBytes
Messages: 302
Registered: October 2008
Location: France
Senior Member
Hi Crydev,

Did you have a look to MemStream or MemReadStream object ?


Regards Razz


[Updated on: Thu, 02 May 2013 20:30]

Report message to a moderator

Re: Memory Mapped Files [message #39813 is a reply to message #39808] Thu, 02 May 2013 20:48 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1780
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi crydev,

crydev wrote on Thu, 02 May 2013 09:38

write data from a list/vector to the memory

Is that really what you wanted to write? If yes, then copying data from Vector to other location in memory can be as simple as calling memcpy(dest, vector.Begin(), count*itemsize).

If you actually meant copying from/to file on disk, then Streams are probably the easiest way to go. AFAIK there is currently nothing using memory mapped files in U++. But to use it for storing, it should be just a simple call to mmap (on Linux) followed by memcpy.

Best regards,
Re: Memory Mapped Files [message #39917 is a reply to message #39813] Sat, 11 May 2013 10:02 Go to previous message
mirek is currently online  mirek
Messages: 13392
Registered: November 2005
Ultimate Member
U++ actually has file mapping encapsulated to hide platform differencies, see FileMapping.
Previous Topic: About RS232
Next Topic: [FIXED] Memory leak in FreeType.
Goto Forum:

Current Time: Wed Aug 04 18:40:22 CEST 2021

Total time taken to generate the page: 0.01204 seconds