summaryrefslogtreecommitdiffstats
path: root/input/input.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-23 17:36:19 +0100
committerwm4 <wm4@nowhere>2020-02-23 17:36:27 +0100
commitf6615f00eeb05f072af24d132a78786c65e6aa80 (patch)
tree3ffb38d6c8834d49c8826069a9666fb308d8ecdc /input/input.h
parenta9586625d1002fdb800303a464691d85d4da91df (diff)
downloadmpv-f6615f00eeb05f072af24d132a78786c65e6aa80.tar.bz2
mpv-f6615f00eeb05f072af24d132a78786c65e6aa80.tar.xz
ta: remove seperate internal "ext" header
The ta_ext_header was allocated on demand for allocations which have child-allocations or destructors. In theory, it saved 2 words for every TA leaf allocation. It had the very API-visible problem that setting a parent or destructor could fail. (Although in most cases, the failure was part of an allocation call anyway. Also, mpv code generally used the early-failure variants, so it didn't matter.) I think this was a bit too complex. These 2 words don't really matter; if you have memory allocations where you are worried about overhead, then these simply shouldn't use TA. Also, we never added new features to TA that would have needed more "optional" header fields, which would have justified the use of such a separately allocated header struct. This uses quite straight-forward data structures. The only strange thing is that ta_header.parent is NULL for most child allocations. That is because we don't want to iterate over all children when the parent is reallocated (yes, that is allowed, yes mpv makes use of it). The new code has a few more special cases, because the list sentinel concept isn't used anymore. Using it would have made the code more unnatural/complex, because ta_ext_header doesn't exist anymore.
Diffstat (limited to 'input/input.h')
0 files changed, 0 insertions, 0 deletions