Closed Smilex closed 6 years ago
Hi, looks good.
I don't see why you have to allocate and copy memory from argv. All CToy callbacks originate from the main function so you can just copy the pointer of argv. ctoyargc = argc; ctoyargv = argv;
ps: These two lines should also be added to ctoy_native.c
It just made a lot of sense at the time that argv wouldn't persist, but I'm not thinking hard about any of this, I'm trying to be fast. Although I don't understand all the details of argv, I see now that it makes no sense to copy it.
I don't have a ctoy_native.c?
ctoy_native is there https://github.com/anael-seghezzi/CToy/tree/master/ressources/tool/build_native/src (it's a part of the tool that allow to compile in native with an optimized compiler like gcc)
It keeps the copy operation as it was and now has the API you suggested