Source File
load_unsafe.go
Belonging Package
github.com/pierrec/lz4/v4/internal/lz4block
//go:build (amd64 || arm64) && gc && !noasm && !nounsafe && !puregopackage lz4blockimport// srcReader loads little endian words from a byte slice without bounds// checks, on little endian platforms with fast unaligned loads. The noasm,// nounsafe and purego tags select the portable version instead. Callers must// only load within the slice, and say why their positions are in bounds.type srcReader struct{ p unsafe.Pointer }// newSrcReader returns a reader for b, which must not be empty.func newSrcReader( []byte) srcReader { return srcReader{unsafe.Pointer(&[0])} }func ( srcReader) ( []byte, int) uint16 { return *(*uint16)(unsafe.Add(.p, )) }func ( srcReader) ( []byte, int) uint32 { return *(*uint32)(unsafe.Add(.p, )) }func ( srcReader) ( []byte, int) uint64 { return *(*uint64)(unsafe.Add(.p, )) }
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |