diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-08-21 08:53:49 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-21 10:38:30 -0700 |
commit | 52ac7dc5d0aa07f36810770dfed516a08d490490 (patch) | |
tree | 6047a2fc79b0277b7bf605e3ab386af0489f2ef9 /src/panfrost | |
parent | bf036e127f295d9870985ed3dc782365cd260758 (diff) |
pan/midgard: Allocate `dependencies` on stack
It's small; this way we don't leak memory.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost')
-rw-r--r-- | src/panfrost/midgard/midgard_schedule.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index ab96a4b8fff..66502813748 100644 --- a/src/panfrost/midgard/midgard_schedule.c +++ b/src/panfrost/midgard/midgard_schedule.c @@ -136,7 +136,10 @@ can_writeout_fragment(compiler_context *ctx, midgard_instruction **bundle, unsig uint8_t r0_written_mask = 0x0; /* Simultaneously we scan for the set of dependencies */ - BITSET_WORD *dependencies = calloc(sizeof(BITSET_WORD), BITSET_WORDS(node_count)); + + size_t sz = sizeof(BITSET_WORD) * BITSET_WORDS(node_count); + BITSET_WORD *dependencies = alloca(sz); + memset(dependencies, 0, sz); for (unsigned i = 0; i < count; ++i) { midgard_instruction *ins = bundle[i]; |