summaryrefslogtreecommitdiffstats
path: root/src/panfrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-08-21 08:53:49 -0700
committerAlyssa Rosenzweig <[email protected]>2019-08-21 10:38:30 -0700
commit52ac7dc5d0aa07f36810770dfed516a08d490490 (patch)
tree6047a2fc79b0277b7bf605e3ab386af0489f2ef9 /src/panfrost
parentbf036e127f295d9870985ed3dc782365cd260758 (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.c5
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];