diff options
author | Alejandro Piñeiro <[email protected]> | 2019-11-28 21:49:02 +0100 |
---|---|---|
committer | Alejandro Piñeiro <[email protected]> | 2019-12-02 13:59:28 +0100 |
commit | b6fd679a9e68e1707bffda48ed7cb0bb79ea9f23 (patch) | |
tree | b0fc8b743db0712ca3a3028b068b62eb7a2c3e35 /src/mesa/main/execmem.c | |
parent | 35fab1ba3395604f748cd13ba82991372ca0cae7 (diff) |
mesa/main/util: moving gallium u_mm to util, remove main/mm
Right now there are two copies of mm:
* mesa/main/mm.[ch]
* gallium/auxiliary/util/u_mm.[ch]
At some point they splitted, and from the commit message it was not
clear why it was not possible to have only one copy at a common place.
Taking into account that was several years ago, Im assuming that it
was not possible then.
This change would allow to have one copy of the same code, and also
being able to use that code out of mesa/main or gallium, if needed.
This commit moves u_mm and removes mm, as u_mm has slightly more
changes.
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/mesa/main/execmem.c')
-rw-r--r-- | src/mesa/main/execmem.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/main/execmem.c b/src/mesa/main/execmem.c index 2142b50a6e9..8c7325bebf3 100644 --- a/src/mesa/main/execmem.c +++ b/src/mesa/main/execmem.c @@ -46,7 +46,7 @@ #include <unistd.h> #include <sys/mman.h> -#include "mm.h" +#include "util/u_mm.h" #ifdef MESA_SELINUX #include <selinux/selinux.h> @@ -78,11 +78,11 @@ init_heap(void) #endif if (!exec_heap) - exec_heap = mmInit( 0, EXEC_HEAP_SIZE ); + exec_heap = u_mmInit( 0, EXEC_HEAP_SIZE ); if (!exec_mem) exec_mem = mmap(NULL, EXEC_HEAP_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); return (exec_mem != MAP_FAILED); } @@ -101,7 +101,7 @@ _mesa_exec_malloc(GLuint size) if (exec_heap) { size = (size + 31) & ~31; - block = mmAllocMem( exec_heap, size, 32, 0 ); + block = u_mmAllocMem( exec_heap, size, 32, 0 ); } if (block) @@ -122,10 +122,10 @@ _mesa_exec_free(void *addr) mtx_lock(&exec_mutex); if (exec_heap) { - struct mem_block *block = mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem); + struct mem_block *block = u_mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem); if (block) - mmFreeMem(block); + u_mmFreeMem(block); } mtx_unlock(&exec_mutex); |