mirror of
				https://git.wownero.com/wownero/RandomWOW.git
				synced 2024-08-15 00:23:14 +00:00 
			
		
		
		
	Invalidate CPU I-cache on Apple Silicon
Call __builtin___clear_cache() after pthread_jit_write_protect_np() according to https://developer.apple.com/documentation/apple-silicon/porting-just-in-time-compilers-to-apple-silicon
This commit is contained in:
		
							parent
							
								
									261d58c77f
								
							
						
					
					
						commit
						7245f13c7e
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		|  | @ -189,6 +189,7 @@ void setPagesRX(void* ptr, size_t bytes) { | |||
| 	&& MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0 | ||||
| 	if (__builtin_available(macOS 11.0, *)) { | ||||
| 		pthread_jit_write_protect_np(1); | ||||
| 		__builtin___clear_cache((char*)ptr, ((char*)ptr) + bytes); | ||||
| 	} else { | ||||
| 		pageProtect(ptr, bytes, PAGE_EXECUTE_READ, &errfunc); | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue