mirror of
				https://github.com/bytecodealliance/wasm-micro-runtime.git
				synced 2025-10-31 13:17:31 +00:00 
			
		
		
		
	Add some more comments on WASM_STACK_GUARD_SIZE (#3380)
This commit is contained in:
		
							parent
							
								
									4abf288c94
								
							
						
					
					
						commit
						163f29e51b
					
				|  | @ -470,8 +470,23 @@ | |||
|  *     200 bytes (release build, macOS/amd64) | ||||
|  *     2600 bytes (debug build, macOS/amd64) | ||||
|  * | ||||
|  *   libc snprintf (used by eg. wasm_runtime_set_exception) consumes about | ||||
|  *   1600 bytes stack on macOS/amd64, about 2000 bytes on Ubuntu amd64 20.04. | ||||
|  * - platform-provided functions (eg. libc) | ||||
|  * | ||||
|  *   the following are examples of the stack consumptions observed for | ||||
|  *   host APIs. | ||||
|  * | ||||
|  *   snprintf: (used by eg. wasm_runtime_set_exception) | ||||
|  *   - about 1600 bytes on macOS/amd64 | ||||
|  *   - about 2000 bytes on Ubuntu amd64 20.04 | ||||
|  * | ||||
|  *   gethostbyname: | ||||
|  *   - 3KB-6KB on macOS/amd64 | ||||
|  *   - 10KB on Ubuntu amd64 20.04 | ||||
|  * | ||||
|  *   getaddrinfo: | ||||
|  *   - 4KB-17KB on macOS/amd64 | ||||
|  *   - 12KB on Ubuntu amd64 20.04 | ||||
|  *   - 0.3-1.5KB on NuttX/esp32s3 | ||||
|  * | ||||
|  * - stack check wrapper functions generated by the aot compiler | ||||
|  *   (--stack-bounds-checks=1) | ||||
|  | @ -480,6 +495,9 @@ | |||
|  *   "precheck functions themselves consume relatively large amount of stack" | ||||
|  *   when it detects wrapper functions requiring more than 1KB. | ||||
|  * | ||||
|  * - the ABI-defined red zone. eg. 128 bytes for SYSV x86-64 ABI. | ||||
|  *   cf. https://en.wikipedia.org/wiki/Red_zone_(computing)
 | ||||
|  * | ||||
|  * Note: on platforms with lazy function binding, don't forget to consider | ||||
|  * the symbol resolution overhead on the first call. For example, | ||||
|  * on Ubuntu amd64 20.04, it seems to consume about 1500 bytes. | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 YAMAMOTO Takashi
						YAMAMOTO Takashi