[qfvis] Use cmem for portal flow stack node allocation

The portal flow stack nodes contain a simd vector, which requires
16-byte alignment. However, on 32-bit Windows, malloc returns 8-byte
aligned memory, leading to eventual segfaults. Since pstack_t is 48
bytes on 32-bit systems, it fits nicely into a 64-byte aligned cache
line (or two on 64-bit systems due to being 80 bytes).
This commit is contained in:
Bill Currie 2021-08-13 11:22:36 +09:00
parent 6fb6885b88
commit d88bd96390

View file

@ -79,7 +79,7 @@ new_stack (threaddata_t *td)
{ {
pstack_t *stack; pstack_t *stack;
stack = malloc (sizeof (pstack_t)); stack = cmemalloc (td->memsuper, sizeof (pstack_t));
stack->next = 0; stack->next = 0;
stack->mightsee = set_new_size_r (&td->set_pool, portalclusters); stack->mightsee = set_new_size_r (&td->set_pool, portalclusters);
td->stats.stack_alloc++; td->stats.stack_alloc++;