mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2026-10-10 13:03:09 +08:00
fix: prevent panic in unaligned 64-bit atomic (#2637)
* fix(net): prevent panic in unaligned 64-bit atomic on ARMv7 Convert int64 fields written and readingID to atomic.Int64 guarantees 8-byte alignment on 32-bit ARM architectures. Unaligned 64-bit atomics fault with SIGILL on armv5/armv6 and armv7. Fixes file copy operations. * fix(atomic): migrate more atomic useage * fix(alias): improve link handling and add Clone method for Link struct * fix warn * fix(mem): simplify memory reservation handling in MemoryGrowCheck * fix(link): simplify link handling by using Clone method * fix bug * fix(hash): typo Signed-off-by: Yinan Qin <a.elysia@proton.me> --------- Signed-off-by: Yinan Qin <a.elysia@proton.me> Co-authored-by: Elysia <a.elysia@proton.me> Co-authored-by: j2rong4cn <j2rong@qq.com>
This commit is contained in:
+3
-3
@@ -111,13 +111,13 @@ func GetPathHierarchy(path string) []string {
|
||||
|
||||
hierarchy := []string{"/"}
|
||||
|
||||
parts := strings.SplitSeq(path, "/")
|
||||
var currentPath strings.Builder
|
||||
for part := range parts {
|
||||
for part := range strings.SplitSeq(path, "/") {
|
||||
if part == "" {
|
||||
continue
|
||||
}
|
||||
currentPath.WriteString("/" + part)
|
||||
currentPath.WriteString("/")
|
||||
currentPath.WriteString(part)
|
||||
hierarchy = append(hierarchy, currentPath.String())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user