Posted: Thu Nov 20, 2014 2:36 am Post subject: Writing 20 MB of globalalloc'd memory to zeros
I have a program that I wrote that reads a file into memory (using readRegionFromFile). This file could be rather large (up to 20 MB), so I'm using globalalloc. The problem is that, when I need to read the file into memory again, unless it has gotten longer or stayed the same length, there will be extra, leftover bytes at the end of the memory region. How can I make sure that it is zero'd before I read? I can use either assembly or lua, either one works. Thanks! _________________
Hm, I suppose you're right. How, though, can I find the size of the file that I read in? I know I can use writeByte from there to zero-terminate it, but I need to know what address to terminate at. _________________
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum