thisistherk / fast_obj

Fast C OBJ parser
MIT License
616 stars 46 forks source link

Adds big obj files support #11

Closed Kuranes closed 4 years ago

Kuranes commented 4 years ago

Problem: on a 22gb file, it fails on "out of bound write" in the arary_size/mgrow/ngrow macros

Fix: using size_t on 64bits for arithmetic ptr alloc/index system fixes it

thisistherk commented 4 years ago

Thanks for the patch - 22Gb!! Am a bit wary of just changing to size_t as it means a memory increase for most users that don't need to cope with files that size - would it be possible to typedef a fastObjUInt or something instead to make it configurable? Then add a #define to switch between (and default to 32-bit if not set)

Kuranes commented 4 years ago

yes, makes sense. I'll remake a PR with define + typedef

Kuranes commented 4 years ago

repushed with fixes

thisistherk commented 4 years ago

Awesome - thank you!

Kuranes commented 4 years ago

Thank you your work & sharing the library