Jump to content
  • Advertisement

Archived

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

krakrazor

Loading files to memory

This topic is 5330 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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!