Thanks for taking the time to respond! I'm new here, and still finding my way around.
Let me respond to everything:
> A custom allocator is not a new idea. TinyCC has already a custom allocator and uses it by default.
I
'm using libtcc in my application, and I didn't see a way to tell libtcc to use my _application_'s allocator.
If by "custom allocator" you mean tcc_realloc()/tcc_realloc_debug() etc, that's fine, but unless
I can replace them the fact that it's "custom" does me no good.
> How often will it be useful for a libtcc user to force TinyCC to use an application provided allocator?
I have no idea, but if the application is a language that uses libtcc as a back-end then perhaps often.
libtcc is reliable enough to be part of long-lived sophisticated applications. Such applications
often care a great deal about memory management.
> You add an overhead for every user of TinyCC for every memory allocation/free.
Yes. The preexisting tcc_realloc() called realloc() directly, mine calls a function which calls realloc().
I measured it on some large input (40K lines of C) and saw no difference.
> * it is a far to big change for a release candidate
That is not up to me to evaluate. But as the commit message says, the resulting code is quite
a bit more clear. The diffs don't show that! But if you look I"ll bet your eyeballs would agree.
> * it needs a lot of testing
I wasn't aware of the release candidate status, but I have tested it extensively.
With tcc's tests, with my application, with valgrind. Personally, I'm hard to satisfy...
but I'm satisfied.
> * it adds more complexity
I would seriously claim that it is _simpler_. Again, the diffs don't show that but
the resulting code is more modular and easier to read. The #defines are much
better organized, and my addition of "void libc_free(void *ptr)" makes what was
slightly obscure code more intelligible.
Thanks again. If it turns out that it needs to be reverted for the release, that's fine.
In that case, I'd certainly like it to become official after the release is tagged.