summaryrefslogtreecommitdiff
path: root/COPYING
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-11-18 21:40:58 -0800
committerVito Caputo <vcaputo@pengaru.com>2020-11-18 21:40:58 -0800
commit58563f46c53d4677f8db57bb0689614834fdc43b (patch)
treea960c38a48d9814be60c76bc4bfabeb89fe3435d /COPYING
parent7c196762e4cabf5582116091bcf0818f4c2d612d (diff)
thunk: clear thunk instance payloads
Since thunk instances are utilized via initializer functions which always initialize all the environment members, it made sense to use plain malloc(). But with the addition of payloads, there's a component of the allocation which gets split out for the caller to make use of in a much more ad-hoc fashion. In my personal programming style, I tend to take advantage of the assumption that allocations are zeroed. The returned payload is essentially used as a heap allocation, just coupled to the thunk instance in terms of life cycle. So I prefer the payload space be zeroed on allocation. Since it still seems sensible to leave the thunk's environment part of the instance exclusively initialized by it's init function, this commit leaves the plain malloc and just memset's the payload when present.
Diffstat (limited to 'COPYING')
0 files changed, 0 insertions, 0 deletions
© All Rights Reserved