First of all - thank you everyone for the answers.
Secondly - I was actually considering augmenting the existing code
with the environment handles, but as Paul said that is a lot of work
and bloat. Also I like that idea of using different threads.
There might be another "good enough approach" that would for a single
thread in my situation - freeing all the memory that jansson allocated
during processing of one input, changing the allocator and then
processing another input. The only question that I have - how can I
make sure that everything was freed? Also - how can I check if there
are any references dangling?
My aim right now is a function like "int
jansson_free_all_the_things(void)" that:
- returns 0 and does nothing if there exist dangling references
- returns 1 and frees all the memory allocated if there are no
dangling references
Any tips how to start with this?
On Jun 3, 8:05 pm, Paul Harris <
harris...@gmail.com> wrote:
> On Sunday, June 3, 2012 2:09:04 AM UTC+8, Petri Lehtinen wrote:
>
> > rogerz wrote:
> > > On Fri, Jun 1, 2012 at 11:41 PM, Bart Siwek <
bartlomiej.si...@gmail.com>