Something went wrong. Try again.
🎥 Command line media player
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940TA ("Tree Allocator") is a wrapper around malloc() and related functions,adding features like automatically freeing sub-trees of memory allocations ifa parent allocation is freed.Generally, the idea is that every TA allocation can have a parent (indicatedby the ta_parent argument in allocation function calls). If a parent is freed,its child allocations are automatically freed as well. It is also allowed tofree a child before the parent, or to move a child to another parent withta_set_parent().It also provides a bunch of convenience macros and debugging facilities.The TA functions are documented in the implementation files (ta.c, ta_utils.c).TA is intended to be useable as library independent from mpv. It doesn'tdepend on anything mpv specific.Note:-----mpv doesn't use the TA API yet for two reasons: first, the TA API is notnecessarily finalized yet. Second, it should be easily possible to revertthe commit adding TA, and changing all the code would not allow this.Especially the naming schema for some TA functions is still somewhatundecided. (The talloc naming is a bit verbose at times.)For now, mpv goes through a talloc wrapper, which maps the talloc API to TA.New code should still use talloc as well. At one point, all talloc callswill be replaced with TA calls, and the talloc wrapper will be removed.Documentation for the talloc API is here: http://talloc.samba.org/talloc/doc/html/modules.htmlThere are some minor differences with mpv's talloc bridge. mpv calls abort()on allocation failures, and the talloc_set_destructor() signature is slightlydifferent. libtalloc also has a weird 256MB limit per allocation. The tallocwrapper supports only a strict subset of libtalloc functionality used by mpv.