Age | Commit message (Collapse) | Author |
|
|
|
libiou sprouted a thread pool, to make thunks safe for
dispatching/freeing from threads thunk.h needed some
compare-and-swap magic in maintaining those free lists.
Since libiou pulls in pthreads now, bring pthreads in here too.
|
|
Udpate thunk usage througout to explicitly control thunk instance
lifecycles from calleees according to new model.
This enables discarding a bunch of the per-object dispatch
thunks, eliminates some thunk leaks, and I think generally makes
the code more expressive and clear about what's going on.
Keep in mind this is all experimental and and I'm not spending a
whole lot of time on this, it's mostly a toy and exploring some
different programming styles I'd never really consider for
production/real work.
Though it actually has some interesting properties, and produces
some surprisingly succinct and readable listings at times once
you have the cumbersome building blocks in place. Especially for
non-daemon programs where you can basically either log+ignore
errors or treat them as fatal, I think this programming style
might actually have its place.
|
|
thunk.h got some rudimentary environment caching, and in the
process introduced thunk_free().
Update the submodule and replace the bare free(closure) callsites
with thunk_free(closure).
This should help reduce the amount of malloc/free hammering in jio,
though there are still quite a few allocations for object payloads
in e.g. report-entry-arrays, and the object header space is allocated
as a thunk payload which doesn't get environment caching yet.
|
|
thunk_h makes using closure-esque callbacks in C somewhat
convenient.
|