• Advertisement

Archived

This topic is now archived and is closed to further replies.

Loading files to memory

This topic is 5154 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

what would be fastest way of loading files to memory?(in terms of performance when accessing data in memory) would this be a good idea? struct block { char info[block_length]; // block_length set to 65xxx block *nextblock; } struct file { HANDLE *file; int block; block *firstblock; } I''m guessing that''s a very slow process... anyway of allocating blocks of memory to a pointer? maybe something like pointer = new(block, block_length);

Share this post


Link to post
Share on other sites
Advertisement
I''m not seeing what the point behind that block structure is. If you want to load a file into memory, it would probably be just easier to use memory mapped files. mmap() on *nix systems and MapViewOfFile() on Windows.

Share this post


Link to post
Share on other sites
if i do this...

DWORD *pointer;
pointer = MapViewOfFile();


how will i be able to access the info of bytes, lets say for example 0x00BA to 0x00FF of the file?

Share this post


Link to post
Share on other sites
pointer[46], pointer[47], pointer[48], ... pointer[63]

Share this post


Link to post
Share on other sites

  • Advertisement