mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
Use aligned malloc for backing store, if necessary.
This commit is contained in:
parent
ae695e3566
commit
a6f78d4eee
1 changed files with 3 additions and 2 deletions
|
|
@ -15,6 +15,7 @@
|
|||
#include "hash.h"
|
||||
#include "simple_list.h"
|
||||
#include "mm.h"
|
||||
#include "imports.h"
|
||||
|
||||
struct _mesa_HashTable;
|
||||
|
||||
|
|
@ -125,7 +126,7 @@ static struct block *alloc_local( unsigned size )
|
|||
DBG("alloc_local 0x%x\n", size);
|
||||
|
||||
block->mem_type = BM_MEM_LOCAL;
|
||||
block->virtual = malloc(size);
|
||||
block->virtual = ALIGN_MALLOC(size, 1<<7);
|
||||
if (!block->virtual) {
|
||||
free(block);
|
||||
return NULL;
|
||||
|
|
@ -209,7 +210,7 @@ static void free_block( struct bufmgr *bm, struct block *block )
|
|||
break;
|
||||
|
||||
case BM_MEM_LOCAL:
|
||||
free(block->virtual);
|
||||
ALIGN_FREE(block->virtual);
|
||||
free(block);
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue