- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 275 for munmap (0.16 sec)
-
src/syscall/mmap_unix_test.go
package syscall_test import ( "syscall" "testing" ) func TestMmap(t *testing.T) { b, err := syscall.Mmap(-1, 0, syscall.Getpagesize(), syscall.PROT_NONE, syscall.MAP_ANON|syscall.MAP_PRIVATE) if err != nil { t.Fatalf("Mmap: %v", err) } if err := syscall.Munmap(b); err != nil { t.Fatalf("Munmap: %v", err) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 30 23:58:34 UTC 2022 - 500 bytes - Viewed (0) -
src/cmd/link/internal/ld/outbuf_windows.go
package ld import ( "internal/unsafeheader" "syscall" "unsafe" ) // Mmap maps the output file with the given size. It unmaps the old mapping // if it is already mapped. It also flushes any in-heap data to the new // mapping. func (out *OutBuf) Mmap(filesize uint64) error { oldlen := len(out.buf) if oldlen != 0 { out.munmap() } err := out.f.Truncate(int64(filesize)) if err != nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 09 01:59:25 UTC 2022 - 2.3K bytes - Viewed (0) -
src/runtime/os_openbsd_syscall2.go
// munmap calls the munmap system call. It is implemented in assembly. func munmap(addr unsafe.Pointer, n uintptr) func nanotime1() int64 //go:noescape func sigaltstack(new, old *stackt) func fcntl(fd, cmd, arg int32) (ret int32, errno int32) func walltime() (sec int64, nsec int32)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 25 19:53:03 UTC 2024 - 2.5K bytes - Viewed (0) -
src/runtime/race/race_linux_test.go
// doesn't fault. See issue 60825. // Mmap two pages of memory, and make the second page inaccessible, // so we have an address at the end of a page. pagesize := syscall.Getpagesize() b, err := syscall.Mmap(0, 0, 2*pagesize, syscall.PROT_READ|syscall.PROT_WRITE, syscall.MAP_ANON|syscall.MAP_PRIVATE) if err != nil { t.Fatalf("mmap failed %s", err) } defer syscall.Munmap(b) err = syscall.Mprotect(b[pagesize:], syscall.PROT_NONE)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Jun 16 14:09:02 UTC 2023 - 1.9K bytes - Viewed (0) -
src/runtime/race/race_unix_test.go
func TestNonGoMemory(t *testing.T) { data, err := syscall.Mmap(-1, 0, 4096, syscall.PROT_READ|syscall.PROT_WRITE, syscall.MAP_ANON|syscall.MAP_PRIVATE) if err != nil { t.Fatalf("failed to mmap memory: %v", err) } defer syscall.Munmap(data) p := (*uint32)(unsafe.Pointer(&data[0])) atomic.AddUint32(p, 1) (*p)++ if *p != 2 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 09 15:36:26 UTC 2022 - 762 bytes - Viewed (0) -
src/cmd/link/internal/ld/outbuf_nommap.go
//go:build !unix && !windows package ld // Mmap allocates an in-heap output buffer with the given size. It copies // any old data (if any) to the new buffer. func (out *OutBuf) Mmap(filesize uint64) error { // We need space to put all the symbols before we apply relocations. oldheap := out.heap if filesize < uint64(len(oldheap)) { panic("mmap size too small") } out.heap = make([]byte, filesize)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 19 11:20:31 UTC 2024 - 660 bytes - Viewed (0) -
src/runtime/debug/panic_test.go
t.Skip("netbsd-arm doesn't provide fault address (golang.org/issue/45026)") } m, err := syscall.Mmap(-1, 0, 0x1000, syscall.PROT_READ /* Note: no PROT_WRITE */, syscall.MAP_SHARED|syscall.MAP_ANON) if err != nil { t.Fatalf("can't map anonymous memory: %s", err) } defer syscall.Munmap(m) old := debug.SetPanicOnFault(true) defer debug.SetPanicOnFault(old) const lowBits = 0x3e7 defer func() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 28 18:17:57 UTC 2021 - 1.4K bytes - Viewed (0) -
src/runtime/vdso_freebsd_x86.go
if fd < 0 { atomic.Casuintptr(&hpetDevMap[idx], 0, ^uintptr(0)) return } addr, mmapErr := mmap(nil, physPageSize, _PROT_READ, _MAP_SHARED, fd, 0) closefd(fd) newP := uintptr(addr) if mmapErr != 0 { newP = ^uintptr(0) } if !atomic.Casuintptr(&hpetDevMap[idx], 0, newP) && mmapErr == 0 { munmap(addr, physPageSize) } } //go:nosplit func (th *vdsoTimehands) getTimecounter() (uint32, bool) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 25 19:53:03 UTC 2024 - 1.9K bytes - Viewed (0) -
src/runtime/mem_darwin.go
// which prevents us from allocating more stack. // //go:nosplit func sysFreeOS(v unsafe.Pointer, n uintptr) { munmap(v, n) } func sysFaultOS(v unsafe.Pointer, n uintptr) { mmap(v, n, _PROT_NONE, _MAP_ANON|_MAP_PRIVATE|_MAP_FIXED, -1, 0) } func sysReserveOS(v unsafe.Pointer, n uintptr) unsafe.Pointer { p, err := mmap(v, n, _PROT_NONE, _MAP_ANON|_MAP_PRIVATE, -1, 0) if err != 0 { return nil } return p }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Aug 22 19:05:10 UTC 2023 - 2K bytes - Viewed (0) -
src/cmd/link/internal/ld/fallocate_test.go
} if err != nil { t.Fatalf("fallocate failed: %v", err) } break } // Mmap 1 MiB initially, and grow to 2 and 3 MiB. // Check if the file size and disk usage is expected. for _, sz := range []int64{1 << 20, 2 << 20, 3 << 20} { err = out.Mmap(uint64(sz)) if err != nil { t.Fatalf("Mmap failed: %v", err) } stat, err := os.Stat(filename) if err != nil { t.Fatalf("Stat failed: %v", err)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Apr 05 14:17:36 UTC 2023 - 1.7K bytes - Viewed (0)