-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nob_read_entire_file #33
Comments
What exactly do you mean by "breaks"? |
When calling "[ERROR] Could not read file my_custom_file: Success" It's strange to me that the message says "Success", which seems like unexpected behavior. Out of paranoia, I also tested naming the file incorrectly, and that correctly gives the expected "No such file or directory" error message. Again, this is only an issue for the executable built through x86_64-w64-mingw32-gcc. Running on wine, the message is "Success", whereas actual windows it says "No error message". I also don't think it's anything weird with my file because I load other similar (but smaller files) and they work just fine. |
Upon closer inspection, the 2GB limit I'm running into seems to be the ftell returning a long. long m = ftell(f);
if (m < 0) nob_return_defer(false); // returns early for file size > ~2GB The old implementation didn't have that issue (though I understand it was changed for performance reasons). There does exist |
The current implementation of
nob_read_entire_file
breaks for file sizes ~2 GB while using x86_64-w64-mingw32-gcc. Normally, I wouldn't report such a thing because this is kind of a highly specific use-case; however an older version of nob (which I presumably yoinked from musializer) actually worked in this obscure case.old working
nob_read_entire_file
implementation:new broken
nob_read_entire_file
implementation:To be clear, I'm not exactly sure why the old implementation seems to be more resilient. If you'd like me to further investigate, or have any questions for replicating the bug, let me know.
Otherwise, just ignore the issue if this is too specific of a use-case :)
The text was updated successfully, but these errors were encountered: