mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-29 07:32:02 +00:00
[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:
parent
6fb6885b88
commit
d88bd96390
1 changed files with 1 additions and 1 deletions
|
@ -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++;
|
||||||
|
|
Loading…
Reference in a new issue