Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 269 for mmat (0.08 sec)

  1. src/syscall/linkname_unix.go

    //go:build unix
    
    package syscall
    
    import _ "unsafe" // for linkname
    
    // mmap should be an internal detail,
    // but widely used packages access it using linkname.
    // Notable members of the hall of shame include:
    //   - modernc.org/memory
    //   - github.com/ncruces/go-sqlite3
    //
    // Do not remove or change the type signature.
    // See go.dev/issue/67401.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 532 bytes
    - Viewed (0)
  2. src/runtime/race/race_unix_test.go

    )
    
    // Test that race detector does not crash when accessing non-Go allocated memory (issue 9136).
    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)
  3. src/cmd/vendor/golang.org/x/sys/unix/mmap_nomremap.go

    // license that can be found in the LICENSE file.
    
    //go:build aix || darwin || dragonfly || freebsd || openbsd || solaris || zos
    
    package unix
    
    var mapper = &mmapper{
    	active: make(map[*byte][]byte),
    	mmap:   mmap,
    	munmap: munmap,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 05 22:18:42 UTC 2024
    - 343 bytes
    - Viewed (0)
  4. 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)
  5. src/syscall/mmap_unix_test.go

    //go:build unix
    
    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)
  6. 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))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 09 01:59:25 UTC 2022
    - 2.3K bytes
    - Viewed (0)
  7. src/cmd/internal/bio/buf_mmap.go

    	if length < threshold {
    		return nil, false
    	}
    
    	// Have we reached the mmap limit?
    	if atomic.AddInt32(&mmapLimit, -1) < 0 {
    		atomic.AddInt32(&mmapLimit, 1)
    		return nil, false
    	}
    
    	// Page-align the offset.
    	off := r.Offset()
    	align := syscall.Getpagesize()
    	aoff := off &^ int64(align-1)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 19 11:20:31 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  8. src/runtime/os_openbsd_syscall2.go

    // mmap calls the mmap system call. It is implemented in assembly.
    // We only pass the lower 32 bits of file offset to the
    // assembly routine; the higher bits (if required), should be provided
    // by the assembly routine as 0.
    // The err result is an OS error code such as ENOMEM.
    func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uint32) (p unsafe.Pointer, err int)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  9. src/cmd/link/internal/ld/outbuf_darwin.go

    	_, err = fcntl(int(out.f.Fd()), syscall.F_PREALLOCATE, int(uintptr(unsafe.Pointer(store))))
    	return err
    }
    
    func (out *OutBuf) purgeSignatureCache() {
    	// Apparently, the Darwin kernel may cache the code signature at mmap.
    	// When we mmap the output buffer, it doesn't have a code signature
    	// (as we haven't generated one). Invalidate the kernel cache now that
    	// we have generated the signature. See issue #42684.
    	msync(out.buf, syscall.MS_INVALIDATE)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 13 15:50:02 UTC 2022
    - 1.3K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/sys/unix/mremap.go

    	mremap func(oldaddr uintptr, oldlength uintptr, newlength uintptr, flags int, newaddr uintptr) (xaddr uintptr, err error)
    }
    
    var mapper = &mremapMmapper{
    	mmapper: mmapper{
    		active: make(map[*byte][]byte),
    		mmap:   mmap,
    		munmap: munmap,
    	},
    	mremap: mremap,
    }
    
    func (m *mremapMmapper) Mremap(oldData []byte, newLength int, flags int) (data []byte, err error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 1.4K bytes
    - Viewed (0)
Back to top