net-misc/baidupcs-go: drop unused 3.9.5 build patch
因为树上只剩 4.0.2,ebuild 不再引用 `FILESDIR`,所以这个补丁已无引用。 Signed-off-by: Zakk <zakk@gentoozh.org>
This commit is contained in:
1 parent
e8c85618fd
commit
18303862c3
1 file changed
-69
@@ -1,69 +0,0 @@
|
||||
diff --git a/BaiduPCS-Go b/BaiduPCS-Go
|
||||
new file mode 100755
|
||||
index 0000000..d029fb4
|
||||
Binary files /dev/null and b/BaiduPCS-Go differ
|
||||
diff --git a/pcsutil/cachepool/malloc.go b/pcsutil/cachepool/malloc.go
|
||||
index 307a2d4..612fdd9 100644
|
||||
--- a/pcsutil/cachepool/malloc.go
|
||||
+++ b/pcsutil/cachepool/malloc.go
|
||||
@@ -1,3 +1,6 @@
|
||||
+//go:build !go1.23
|
||||
+// +build !go1.23
|
||||
+
|
||||
package cachepool
|
||||
|
||||
import (
|
||||
@@ -5,6 +8,8 @@ import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
+// 函数声明可以省略主体。 这样的声明为Go外部实现的功能(例如汇编例程)提供了签名。这是在汇编中实现函数的方式。
|
||||
+
|
||||
//go:linkname mallocgc runtime.mallocgc
|
||||
func mallocgc(size uintptr, typ uintptr, needzero bool) unsafe.Pointer
|
||||
|
||||
@@ -30,4 +35,4 @@ func RawMallocByteSlice(size int) []byte {
|
||||
Cap: size,
|
||||
}))
|
||||
return b
|
||||
-}
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/pcsutil/cachepool/malloc_go_1.23.go b/pcsutil/cachepool/malloc_go_1.23.go
|
||||
new file mode 100644
|
||||
index 0000000..8c2b78d
|
||||
--- /dev/null
|
||||
+++ b/pcsutil/cachepool/malloc_go_1.23.go
|
||||
@@ -0,0 +1,31 @@
|
||||
+//go:build go1.23
|
||||
+// +build go1.23
|
||||
+
|
||||
+package cachepool
|
||||
+
|
||||
+import (
|
||||
+ "unsafe"
|
||||
+)
|
||||
+
|
||||
+// 说明:
|
||||
+// 由于GO 1.23版本取消了 go:linkname 的支持,所以1.23以及以上版本需要使用本文件替代原始文件 malloc.go
|
||||
+
|
||||
+// RawByteSlice point to runtime.rawbyteslice
|
||||
+func RawByteSlice(size int) (b []byte) {
|
||||
+ bytesArray := make([]byte, size)
|
||||
+ return bytesArray
|
||||
+}
|
||||
+
|
||||
+// RawMalloc allocates a new slice. The slice is not zeroed.
|
||||
+func RawMalloc(size int) unsafe.Pointer {
|
||||
+ bytesArray := make([]byte, size)
|
||||
+ // 使用unsafe.Pointer获取字节数组的指针
|
||||
+ bytesPtr := unsafe.Pointer(&bytesArray[0])
|
||||
+ return bytesPtr
|
||||
+}
|
||||
+
|
||||
+// RawMallocByteSlice allocates a new byte slice. The slice is not zeroed.
|
||||
+func RawMallocByteSlice(size int) []byte {
|
||||
+ bytesArray := make([]byte, size)
|
||||
+ return bytesArray
|
||||
+}
|
||||
\ No newline at end of file
|
||||
Reference in new issue
Block a user