-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
func (m MemoryDeviceType) String() string {
types := [...]string{
"Other",
"Unknown",
"DRAM",
"EDRAM",
"VRAM",
"SRAM",
"RAM",
"ROM",
"FLASH",
"EEPROM",
"FEPROM",
"EPROM",
"CDRAM",
"3DRAM",
"SDRAM",
"SGRAM",
"RDRAM",
"DDR",
"DDR2",
"DDR2 FB-DIMM",
"Reserved1",
"Reserved2",
"Reserved3",
"DDR3",
"FBD2",
"DDR4",
"LPDDR",
"LPDDR2",
"LPDDR3",
"LPDDR4",
"Logical non-volatile device",
"HBM",
"HBM2",
"DDR5",
"LPDDR5",
"HBM3",
}
// 防止越界
if int(m-1) > len(types) {
return types[0]
}
return types[m-1] //没有以上代码,新硬件,这里直接崩溃,有很多类似这种代码,望修正
}
Metadata
Metadata
Assignees
Labels
No labels