зеркало из https://github.com/github/ruby.git
YJIT: Show GCC that the mmap probing loop runs at least once
Fixes: ./src/yjit_asm.c:196:8: warning: 'mem_block' may be used uninitialized [-Wmaybe-uninitialized]
This commit is contained in:
Родитель
00be5846e4
Коммит
6a9e2b3cc3
|
@ -158,8 +158,7 @@ uint8_t *alloc_exec_mem(uint32_t mem_size)
|
|||
uint32_t page_size = (uint32_t)sysconf(_SC_PAGESIZE);
|
||||
uint8_t *req_addr = align_ptr((uint8_t*)&alloc_exec_mem, page_size);
|
||||
|
||||
while (req_addr < (uint8_t*)&alloc_exec_mem + INT32_MAX)
|
||||
{
|
||||
do {
|
||||
// Try to map a chunk of memory as executable
|
||||
mem_block = (uint8_t*)mmap(
|
||||
(void*)req_addr,
|
||||
|
@ -177,7 +176,7 @@ uint8_t *alloc_exec_mem(uint32_t mem_size)
|
|||
|
||||
// +4MB
|
||||
req_addr += 4 * 1024 * 1024;
|
||||
}
|
||||
} while (req_addr < (uint8_t*)&alloc_exec_mem + INT32_MAX);
|
||||
|
||||
// On MacOS and other platforms
|
||||
#else
|
||||
|
|
Загрузка…
Ссылка в новой задаче