Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 275 for munmap (0.24 sec)

  1. src/runtime/runtime_mmap_test.go

    		runtime.Munmap(unsafe.Pointer(uintptr(b)), 2*ps)
    	}
    
    	// Mmap should fail at a half page into the buffer.
    	_, err = runtime.Mmap(unsafe.Pointer(uintptr(b)+ps/2), ps, 0, runtime.MAP_ANON|runtime.MAP_PRIVATE|runtime.MAP_FIXED, -1, 0)
    	if err == 0 {
    		t.Errorf("Mmap should have failed with half-page alignment %d, but succeeded: %v", ps/2, err)
    	}
    
    	// Mmap should succeed at a full page into the buffer.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 29 16:24:51 UTC 2022
    - 1.8K bytes
    - Viewed (0)
  2. src/syscall/syscall_bsd.go

    var mapper = &mmapper{
    	active: make(map[*byte][]byte),
    	mmap:   mmap,
    	munmap: munmap,
    }
    
    func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
    	return mapper.Mmap(fd, offset, length, prot, flags)
    }
    
    func Munmap(b []byte) (err error) {
    	return mapper.Munmap(b)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 07 10:34:48 UTC 2023
    - 13.6K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/sys/unix/syscall_unix.go

    		return errno
    	}
    	delete(m.active, p)
    	return nil
    }
    
    func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
    	return mapper.Mmap(fd, offset, length, prot, flags)
    }
    
    func Munmap(b []byte) (err error) {
    	return mapper.Munmap(b)
    }
    
    func Read(fd int, p []byte) (n int, err error) {
    	n, err = read(fd, p)
    	if raceenabled {
    		if n > 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 16.5K bytes
    - Viewed (0)
  4. src/runtime/mem_bsd.go

    // Don't split the stack as this function may be invoked without a valid G,
    // 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)
    }
    
    // Indicates not to reserve swap space for the mapping.
    const _sunosMAP_NORESERVE = 0x40
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 22 19:05:10 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  5. src/syscall/syscall_solaris.go

    	}
    	return
    }
    
    var mapper = &mmapper{
    	active: make(map[*byte][]byte),
    	mmap:   mmap,
    	munmap: munmap,
    }
    
    func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
    	return mapper.Mmap(fd, offset, length, prot, flags)
    }
    
    func Munmap(b []byte) (err error) {
    	return mapper.Munmap(b)
    }
    
    func Utimes(path string, tv []Timeval) error {
    	if len(tv) != 2 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:03:59 UTC 2024
    - 15.7K bytes
    - Viewed (0)
  6. src/runtime/mem_aix.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)
  7. src/syscall/syscall_aix.go

    var mapper = &mmapper{
    	active: make(map[*byte][]byte),
    	mmap:   mmap,
    	munmap: munmap,
    }
    
    //sys	mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
    //sys	munmap(addr uintptr, length uintptr) (err error)
    
    func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
    	return mapper.Mmap(fd, offset, length, prot, flags)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 13:50:55 UTC 2024
    - 17.9K bytes
    - Viewed (0)
  8. test/recover4.go

    	// Map 16 pages of data with a 4-page hole in the middle.
    	data, err := syscall.Mmap(-1, 0, 16*size, syscall.PROT_READ|syscall.PROT_WRITE, syscall.MAP_ANON|syscall.MAP_PRIVATE)
    	if err != nil {
    		log.Fatalf("mmap: %v", err)
    	}
    
    	// Create a hole in the mapping that's PROT_NONE.
    	// Note that we can't use munmap here because the Go runtime
    	// could create a mapping that ends up in this hole otherwise,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  9. src/runtime/sys_openbsd2.go

    }
    func thrkill_trampoline()
    
    // mmap is used to do low-level memory allocation via mmap. Don't allow stack
    // splits, since this function (used by sysAlloc) is called in a lot of low-level
    // parts of the runtime and callers often assume it won't acquire any locks.
    //
    //go:nosplit
    func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uint32) (unsafe.Pointer, int) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  10. src/syscall/syscall_unix.go

    }
    
    func (m *mmapper) Munmap(data []byte) (err error) {
    	if len(data) == 0 || len(data) != cap(data) {
    		return EINVAL
    	}
    
    	// Find the base of the mapping.
    	p := &data[cap(data)-1]
    	m.Lock()
    	defer m.Unlock()
    	b := m.active[p]
    	if b == nil || &b[0] != &data[0] {
    		return EINVAL
    	}
    
    	// Unmap the memory and update m.
    	if errno := m.munmap(uintptr(unsafe.Pointer(&b[0])), uintptr(len(b))); errno != nil {
    		return errno
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 19 16:19:26 UTC 2024
    - 12.2K bytes
    - Viewed (0)
Back to top