mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-05 01:44:16 +08:00
🎉 Sync 2026-08-31 01:44:18
This commit is contained in:
1 parent
54f91cd44a
commit
1444a85fae
18 files changed
+308
-34
No files matched your search
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=BaiduPCS-Go
|
||||
PKG_VERSION:=4.0.2
|
||||
PKG_RELEASE:=8
|
||||
PKG_RELEASE:=9
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/qjfoidnh/BaiduPCS-Go/tar.gz/v$(PKG_VERSION)?
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
From: coolsnowwolf <coolsnowwolf@gmail.com>
|
||||
Subject: [PATCH] cachepool: stop using runtime.rawbyteslice
|
||||
|
||||
Recent Go releases reject external linkname references to rawbyteslice.
|
||||
Use the language-provided slice allocator for the zeroed allocation path.
|
||||
|
||||
Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
|
||||
---
|
||||
--- a/pcsutil/cachepool/malloc.go
|
||||
+++ b/pcsutil/cachepool/malloc.go
|
||||
@@ -8,12 +8,9 @@
|
||||
//go:linkname mallocgc runtime.mallocgc
|
||||
func mallocgc(size uintptr, typ uintptr, needzero bool) unsafe.Pointer
|
||||
|
||||
-//go:linkname rawbyteslice runtime.rawbyteslice
|
||||
-func rawbyteslice(size int) (b []byte)
|
||||
-
|
||||
-// RawByteSlice point to runtime.rawbyteslice
|
||||
+// RawByteSlice allocates a zeroed byte slice.
|
||||
func RawByteSlice(size int) (b []byte) {
|
||||
- return rawbyteslice(size)
|
||||
+ return make([]byte, size)
|
||||
}
|
||||
|
||||
// RawMalloc allocates a new slice. The slice is not zeroed.
|
||||
Reference in new issue
Block a user