mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-07-03 07:17:44 +00:00
Update vendor (whatsapp)
This commit is contained in:
1
vendor/modernc.org/memory/CONTRIBUTORS
generated
vendored
1
vendor/modernc.org/memory/CONTRIBUTORS
generated
vendored
@ -8,3 +8,4 @@
|
||||
|
||||
Jan Mercl <0xjnml@gmail.com>
|
||||
Steffen Butzer <steffen(dot)butzer@outlook.com>
|
||||
ZHU Zijia <piggynl@outlook.com>
|
||||
|
27
vendor/modernc.org/memory/LICENSE-GO
generated
vendored
Normal file
27
vendor/modernc.org/memory/LICENSE-GO
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Copyright (c) 2009 The Go Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
11
vendor/modernc.org/memory/Makefile
generated
vendored
11
vendor/modernc.org/memory/Makefile
generated
vendored
@ -36,14 +36,23 @@ editor:
|
||||
gofmt -l -s -w *.go
|
||||
GOOS=darwin GOARCH=amd64 go build
|
||||
GOOS=darwin GOARCH=arm64 go build
|
||||
GOOS=freebsd GOARCH=386 go build
|
||||
GOOS=freebsd GOARCH=amd64 go build
|
||||
GOOS=linux GOARCH=386 go build
|
||||
GOOS=linux GOARCH=amd64 go build
|
||||
GOOS=linux GOARCH=arm go build
|
||||
GOOS=linux GOARCH=arm64 go build
|
||||
GOOS=linux GOARCH=mips go build
|
||||
GOOS=linux GOARCH=mips64le go build
|
||||
GOOS=linux GOARCH=mipsle go build
|
||||
GOOS=linux GOARCH=riscv64 go build
|
||||
GOOS=linux GOARCH=s390x go build
|
||||
GOOS=netbsd GOARCH=386 go build
|
||||
GOOS=netbsd GOARCH=amd64 go build
|
||||
GOOS=openbsd GOARCH=386 go build
|
||||
GOOS=openbsd GOARCH=amd64 go build
|
||||
GOOS=windows GOARCH=386 go build
|
||||
GOOS=windows GOARCH=amd64 go build
|
||||
go test 2>&1 | tee log
|
||||
|
||||
internalError:
|
||||
egrep -ho '"internal error.*"' *.go | sort | cat -n
|
||||
|
1
vendor/modernc.org/memory/counters.go
generated
vendored
1
vendor/modernc.org/memory/counters.go
generated
vendored
@ -2,6 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build memory.counters
|
||||
// +build memory.counters
|
||||
|
||||
package memory // import "modernc.org/memory"
|
||||
|
3
vendor/modernc.org/memory/memory32.go
generated
vendored
3
vendor/modernc.org/memory/memory32.go
generated
vendored
@ -2,8 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build 386 || arm || armbe || mips || mipsle || ppc || ppc64le || s390 || s390x || sparc
|
||||
// +build 386 arm armbe mips mipsle ppc ppc64le s390 s390x sparc
|
||||
|
||||
package memory // import "modernc.org/memory"
|
||||
|
||||
type rawmem [1<<31 - 1]byte
|
||||
type rawmem [1<<31 - 2]byte
|
||||
|
3
vendor/modernc.org/memory/memory64.go
generated
vendored
3
vendor/modernc.org/memory/memory64.go
generated
vendored
@ -2,7 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build amd64 amd64p32 arm64 arm64be mips64 mips64le mips64p32 mips64p32le ppc64 sparc64
|
||||
//go:build amd64 || amd64p32 || arm64 || arm64be || mips64 || mips64le || mips64p32 || mips64p32le || ppc64 || sparc64 || riscv64
|
||||
// +build amd64 amd64p32 arm64 arm64be mips64 mips64le mips64p32 mips64p32le ppc64 sparc64 riscv64
|
||||
|
||||
package memory // import "modernc.org/memory"
|
||||
|
||||
|
17
vendor/modernc.org/memory/mmap_fallback.go
generated
vendored
Normal file
17
vendor/modernc.org/memory/mmap_fallback.go
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
// Copyright 2017 The Memory Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
//go:build (darwin && (amd64 || arm64)) || (openbsd && (386 || amd64))
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
_ "unsafe"
|
||||
)
|
||||
|
||||
// Function syscall.mmap for darwin and openbsd calls internal/abi.FuncPCABI0,
|
||||
// which is implemented as a compile intrinsic so the code cannot be reused.
|
||||
// Using go:linkname directive to link mmapSyscall to syscall.mmap
|
||||
|
||||
//go:linkname mmapSyscall syscall.mmap
|
||||
func mmapSyscall(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
21
vendor/modernc.org/memory/mmap_freebsd_32.go
generated
vendored
Normal file
21
vendor/modernc.org/memory/mmap_freebsd_32.go
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE-GO file.
|
||||
|
||||
//go:build freebsd && 386
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_freebsd_386.go
|
||||
func mmapSyscall(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
|
||||
r0, _, e1 := syscall.Syscall9(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0)
|
||||
ret = uintptr(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
21
vendor/modernc.org/memory/mmap_freebsd_64.go
generated
vendored
Normal file
21
vendor/modernc.org/memory/mmap_freebsd_64.go
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE-GO file.
|
||||
|
||||
//go:build freebsd && amd64
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_freebsd_amd64.go;l=1337-1346
|
||||
func mmapSyscall(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
|
||||
r0, _, e1 := syscall.Syscall6(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
|
||||
ret = uintptr(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
33
vendor/modernc.org/memory/mmap_linux_32.go
generated
vendored
Normal file
33
vendor/modernc.org/memory/mmap_linux_32.go
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE-GO file.
|
||||
|
||||
//go:build linux && (386 || arm || mips || mipsle)
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// Function syscall.mmap and syscall.mmap2 are same for linux/386, linux/arm,
|
||||
// linux/mips and linux/mipsle
|
||||
|
||||
// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/syscall_linux_386.go;l=99-105
|
||||
func mmapSyscall(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
|
||||
page := uintptr(offset / 4096)
|
||||
if offset != int64(page)*4096 {
|
||||
return 0, syscall.EINVAL
|
||||
}
|
||||
return mmap2Syscall(addr, length, prot, flags, fd, page)
|
||||
}
|
||||
|
||||
// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_linux_386.go;l=1361-1370
|
||||
func mmap2Syscall(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) {
|
||||
r0, _, e1 := syscall.Syscall6(syscall.SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset))
|
||||
xaddr = uintptr(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
24
vendor/modernc.org/memory/mmap_linux_64.go
generated
vendored
Normal file
24
vendor/modernc.org/memory/mmap_linux_64.go
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE-GO file.
|
||||
|
||||
//go:build linux && (amd64 || arm64 || mips64 || mips64le || riscv64)
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// Function syscall.mmap is same for linux/amd64, linux/arm64, linux/mips64,
|
||||
// linux/mips64le and linux/riscv64.
|
||||
|
||||
// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_linux_amd64.go;l=1575-1584
|
||||
func mmapSyscall(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
|
||||
r0, _, e1 := syscall.Syscall6(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset))
|
||||
xaddr = uintptr(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
23
vendor/modernc.org/memory/mmap_linux_s390x.go
generated
vendored
Normal file
23
vendor/modernc.org/memory/mmap_linux_s390x.go
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE-GO file.
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/syscall_linux_s390x.go;l=105-115
|
||||
// Linux on s390x uses the old mmap interface, which requires arguments to be passed in a struct.
|
||||
// mmap2 also requires arguments to be passed in a struct; it is currently not exposed in <asm/unistd.h>.
|
||||
func mmapSyscall(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
|
||||
mmap_args := [6]uintptr{addr, length, uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)}
|
||||
r0, _, e1 := syscall.Syscall(syscall.SYS_MMAP, uintptr(unsafe.Pointer(&mmap_args[0])), 0, 0)
|
||||
xaddr = uintptr(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
21
vendor/modernc.org/memory/mmap_netbsd_32.go
generated
vendored
Normal file
21
vendor/modernc.org/memory/mmap_netbsd_32.go
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE-GO file.
|
||||
|
||||
//go:build netbsd && 386
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_freebsd_386.go
|
||||
func mmapSyscall(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
|
||||
r0, _, e1 := syscall.Syscall9(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)
|
||||
ret = uintptr(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
21
vendor/modernc.org/memory/mmap_netbsd_64.go
generated
vendored
Normal file
21
vendor/modernc.org/memory/mmap_netbsd_64.go
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE-GO file.
|
||||
|
||||
//go:build netbsd && amd64
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_netbsd_amd64.go;l=1190
|
||||
func mmapSyscall(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
|
||||
r0, _, e1 := syscall.Syscall9(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0)
|
||||
ret = uintptr(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
12
vendor/modernc.org/memory/mmap_unix.go
generated
vendored
12
vendor/modernc.org/memory/mmap_unix.go
generated
vendored
@ -2,6 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE-MMAP-GO file.
|
||||
|
||||
//go:build darwin || dragonfly || freebsd || linux || openbsd || solaris || netbsd
|
||||
// +build darwin dragonfly freebsd linux openbsd solaris netbsd
|
||||
|
||||
// Modifications (c) 2017 The Memory Authors.
|
||||
@ -11,7 +12,6 @@ package memory // import "modernc.org/memory"
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
const pageSizeLog = 20
|
||||
@ -33,13 +33,17 @@ func unmap(addr uintptr, size int) error {
|
||||
// pageSize aligned.
|
||||
func mmap(size int) (uintptr, int, error) {
|
||||
size = roundup(size, osPageSize)
|
||||
b, err := syscall.Mmap(-1, 0, size+pageSize, syscall.PROT_READ|syscall.PROT_WRITE, syscall.MAP_SHARED|syscall.MAP_ANON)
|
||||
// The actual mmap syscall varies by architecture. mmapSyscall provides same
|
||||
// functionality as the unexported funtion syscall.mmap and is declared in
|
||||
// mmap_*_*.go and mmap_fallback.go. To add support for a new architecture,
|
||||
// check function mmap in src/syscall/syscall_*_*.go or
|
||||
// src/syscall/zsyscall_*_*.go in Go's source code.
|
||||
p, err := mmapSyscall(0, uintptr(size+pageSize), syscall.PROT_READ|syscall.PROT_WRITE, syscall.MAP_PRIVATE|syscall.MAP_ANON, -1, 0)
|
||||
if err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
|
||||
n := len(b)
|
||||
p := uintptr(unsafe.Pointer(&b[0]))
|
||||
n := size + pageSize
|
||||
if p&uintptr(osPageMask) != 0 {
|
||||
panic("internal error")
|
||||
}
|
||||
|
1
vendor/modernc.org/memory/nocounters.go
generated
vendored
1
vendor/modernc.org/memory/nocounters.go
generated
vendored
@ -2,6 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !memory.counters
|
||||
// +build !memory.counters
|
||||
|
||||
package memory // import "modernc.org/memory"
|
||||
|
1
vendor/modernc.org/memory/trace_disabled.go
generated
vendored
1
vendor/modernc.org/memory/trace_disabled.go
generated
vendored
@ -2,6 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !memory.trace
|
||||
// +build !memory.trace
|
||||
|
||||
package memory // import "modernc.org/memory"
|
||||
|
1
vendor/modernc.org/memory/trace_enabled.go
generated
vendored
1
vendor/modernc.org/memory/trace_enabled.go
generated
vendored
@ -2,6 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build memory.trace
|
||||
// +build memory.trace
|
||||
|
||||
package memory // import "modernc.org/memory"
|
||||
|
Reference in New Issue
Block a user