mirror of
https://github.com/gofiber/fiber.git
synced 2025-09-04 19:35:47 +00:00
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
19 lines
463 B
Go
19 lines
463 B
Go
package fiber
|
|
|
|
import (
|
|
"unsafe"
|
|
)
|
|
|
|
//go:linkname runtimeRodata runtime.rodata
|
|
var runtimeRodata byte
|
|
|
|
//go:linkname runtimeErodata runtime.erodata
|
|
var runtimeErodata byte
|
|
|
|
func isReadOnly(p unsafe.Pointer) bool {
|
|
start := uintptr(unsafe.Pointer(&runtimeRodata)) //nolint:gosec // converting runtime symbols
|
|
end := uintptr(unsafe.Pointer(&runtimeErodata)) //nolint:gosec // converting runtime symbols
|
|
addr := uintptr(p)
|
|
return addr >= start && addr < end
|
|
}
|