scheduler: task.Data made 64bit to avoid overflow
Этот коммит содержится в:
		
							родитель
							
								
									c5ea1fde61
								
							
						
					
					
						коммит
						2f248bbf8b
					
				
					 4 изменённых файлов: 4 добавлений и 4 удалений
				
			
		
							
								
								
									
										2
									
								
								compiler/testdata/goroutine-cortex-m-qemu.ll
									
										
									
									
										предоставленный
									
									
								
							
							
						
						
									
										2
									
								
								compiler/testdata/goroutine-cortex-m-qemu.ll
									
										
									
									
										предоставленный
									
									
								
							| 
						 | 
					@ -5,7 +5,7 @@ target triple = "armv7m-none-eabi"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%runtime.channel = type { i32, i32, i8, %runtime.channelBlockedList*, i32, i32, i32, i8* }
 | 
					%runtime.channel = type { i32, i32, i8, %runtime.channelBlockedList*, i32, i32, i32, i8* }
 | 
				
			||||||
%runtime.channelBlockedList = type { %runtime.channelBlockedList*, %"internal/task.Task"*, %runtime.chanSelectState*, { %runtime.channelBlockedList*, i32, i32 } }
 | 
					%runtime.channelBlockedList = type { %runtime.channelBlockedList*, %"internal/task.Task"*, %runtime.chanSelectState*, { %runtime.channelBlockedList*, i32, i32 } }
 | 
				
			||||||
%"internal/task.Task" = type { %"internal/task.Task"*, i8*, i32, %"internal/task.state" }
 | 
					%"internal/task.Task" = type { %"internal/task.Task"*, i8*, i64, %"internal/task.state" }
 | 
				
			||||||
%"internal/task.state" = type { i32, i32* }
 | 
					%"internal/task.state" = type { i32, i32* }
 | 
				
			||||||
%runtime.chanSelectState = type { %runtime.channel*, i8* }
 | 
					%runtime.chanSelectState = type { %runtime.channel*, i8* }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								compiler/testdata/goroutine-wasm.ll
									
										
									
									
										предоставленный
									
									
								
							
							
						
						
									
										2
									
								
								compiler/testdata/goroutine-wasm.ll
									
										
									
									
										предоставленный
									
									
								
							| 
						 | 
					@ -6,7 +6,7 @@ target triple = "wasm32--wasi"
 | 
				
			||||||
%runtime.funcValueWithSignature = type { i32, i8* }
 | 
					%runtime.funcValueWithSignature = type { i32, i8* }
 | 
				
			||||||
%runtime.channel = type { i32, i32, i8, %runtime.channelBlockedList*, i32, i32, i32, i8* }
 | 
					%runtime.channel = type { i32, i32, i8, %runtime.channelBlockedList*, i32, i32, i32, i8* }
 | 
				
			||||||
%runtime.channelBlockedList = type { %runtime.channelBlockedList*, %"internal/task.Task"*, %runtime.chanSelectState*, { %runtime.channelBlockedList*, i32, i32 } }
 | 
					%runtime.channelBlockedList = type { %runtime.channelBlockedList*, %"internal/task.Task"*, %runtime.chanSelectState*, { %runtime.channelBlockedList*, i32, i32 } }
 | 
				
			||||||
%"internal/task.Task" = type { %"internal/task.Task"*, i8*, i32, %"internal/task.state" }
 | 
					%"internal/task.Task" = type { %"internal/task.Task"*, i8*, i64, %"internal/task.state" }
 | 
				
			||||||
%"internal/task.state" = type { i8* }
 | 
					%"internal/task.state" = type { i8* }
 | 
				
			||||||
%runtime.chanSelectState = type { %runtime.channel*, i8* }
 | 
					%runtime.chanSelectState = type { %runtime.channel*, i8* }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,7 +13,7 @@ type Task struct {
 | 
				
			||||||
	Ptr unsafe.Pointer
 | 
						Ptr unsafe.Pointer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Data is a field which can be used for storing state information.
 | 
						// Data is a field which can be used for storing state information.
 | 
				
			||||||
	Data uint
 | 
						Data uint64
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// state is the underlying running state of the task.
 | 
						// state is the underlying running state of the task.
 | 
				
			||||||
	state state
 | 
						state state
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -88,7 +88,7 @@ func addSleepTask(t *task.Task, duration timeUnit) {
 | 
				
			||||||
			panic("runtime: addSleepTask: expected next task to be nil")
 | 
								panic("runtime: addSleepTask: expected next task to be nil")
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	t.Data = uint(duration) // TODO: longer durations
 | 
						t.Data = uint64(duration)
 | 
				
			||||||
	now := ticks()
 | 
						now := ticks()
 | 
				
			||||||
	if sleepQueue == nil {
 | 
						if sleepQueue == nil {
 | 
				
			||||||
		scheduleLog("  -> sleep new queue")
 | 
							scheduleLog("  -> sleep new queue")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Загрузка…
	
	Создание таблицы
		
		Сослаться в новой задаче