[chore]: Bump github.com/gin-contrib/cors from 1.5.0 to 1.7.0 (#2745)

This commit is contained in:
dependabot[bot] 2024-03-11 10:12:06 +00:00 committed by GitHub
commit e24efcac8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
158 changed files with 11727 additions and 4290 deletions

View file

@ -1,5 +1,5 @@
//go:build go1.21 && !go1.22
// +build go1.21,!go1.22
//go:build go1.21 && !go1.23
// +build go1.21,!go1.23
/*
* Copyright 2021 ByteDance Inc.

View file

@ -1,5 +1,5 @@
// go:build go1.18 && !go1.22
// +build go1.18,!go1.22
// go:build go1.18 && !go1.23
// +build go1.18,!go1.23
/*
* Copyright 2021 ByteDance Inc.

View file

@ -1,5 +1,4 @@
//go:build go1.16 && !go1.22
// +build go1.16,!go1.22
// +build go1.16,!go1.23
/*
* Copyright 2021 ByteDance Inc.

View file

@ -1,5 +1,5 @@
//go:build darwin || linux
// +build darwin linux
//go:build !windows
// +build !windows
/**
* Copyright 2023 ByteDance Inc.

View file

@ -17,7 +17,8 @@
package loader
import (
`sync`
"sync/atomic"
"unsafe"
_ `unsafe`
)
@ -25,16 +26,35 @@ import (
//goland:noinspection GoUnusedGlobalVariable
var lastmoduledatap *moduledata
var moduledataMux sync.Mutex
func registerModule(mod *moduledata) {
moduledataMux.Lock()
lastmoduledatap.next = mod
lastmoduledatap = mod
moduledataMux.Unlock()
registerModuleLockFree(&lastmoduledatap, mod)
}
//go:linkname moduledataverify1 runtime.moduledataverify1
func moduledataverify1(_ *moduledata)
func registerModuleLockFree(tail **moduledata, mod *moduledata) {
for {
oldTail := loadModule(tail)
if casModule(tail, oldTail, mod) {
storeModule(&oldTail.next, mod)
break
}
}
}
func loadModule(p **moduledata) *moduledata {
return (*moduledata)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p))))
}
func storeModule(p **moduledata, value *moduledata) {
atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(value))
}
func casModule(p **moduledata, oldValue *moduledata, newValue *moduledata) bool {
return atomic.CompareAndSwapPointer(
(*unsafe.Pointer)(unsafe.Pointer(p)),
unsafe.Pointer(oldValue),
unsafe.Pointer(newValue),
)
}