Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 284 for Malloc (0.22 sec)

  1. src/runtime/os_aix.go

    }
    
    //go:nosplit
    func semacreate(mp *m) {
    	if mp.waitsema != 0 {
    		return
    	}
    
    	var sem *semt
    
    	// Call libc's malloc rather than malloc. This will
    	// allocate space on the C heap. We can't call mallocgc
    	// here because it could cause a deadlock.
    	sem = (*semt)(malloc(unsafe.Sizeof(*sem)))
    	if sem_init(sem, 0, 0) != 0 {
    		throw("sem_init")
    	}
    	mp.waitsema = uintptr(unsafe.Pointer(sem))
    }
    
    //go:nosplit
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  2. src/net/cgo_unix_cgo.go

    	_C_uint            = C.uint
    	_C_socklen_t       = C.socklen_t
    	_C_struct_addrinfo = C.struct_addrinfo
    	_C_struct_sockaddr = C.struct_sockaddr
    )
    
    func _C_malloc(n uintptr) unsafe.Pointer { return C.malloc(C.size_t(n)) }
    func _C_free(p unsafe.Pointer)           { C.free(p) }
    
    func _C_ai_addr(ai *_C_struct_addrinfo) **_C_struct_sockaddr { return &ai.ai_addr }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 15 17:49:28 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  3. src/runtime/os3_solaris.go

    	return true
    }
    
    //go:nosplit
    func semacreate(mp *m) {
    	if mp.waitsema != 0 {
    		return
    	}
    
    	var sem *semt
    
    	// Call libc's malloc rather than malloc. This will
    	// allocate space on the C heap. We can't call malloc
    	// here because it could cause a deadlock.
    	mp.libcall.fn = uintptr(unsafe.Pointer(&libc_malloc))
    	mp.libcall.n = 1
    	mp.scratch = mscratch{}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  4. src/internal/trace/testdata/testprog/stress.go

    	go func() {
    		runtime.LockOSThread()
    		for {
    			select {
    			case <-done:
    				return
    			default:
    				runtime.Gosched()
    			}
    		}
    	}()
    
    	runtime.GC()
    	// Trigger GC from malloc.
    	n := 512
    	for i := 0; i < n; i++ {
    		_ = make([]byte, 1<<20)
    	}
    
    	// Create a bunch of busy goroutines to load all Ps.
    	for p := 0; p < 10; p++ {
    		wg.Add(1)
    		go func() {
    			// Do something useful.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go

    // such as this one:
    //
    //	package p
    //	import "C"
    //	import "fmt"
    //	type T int
    //	const k = 3
    //	var x, y = fmt.Println()
    //	func f() { ... }
    //	func g() { ... C.malloc(k) ... }
    //	func (T) f(int) string { ... }
    //
    // we synthesize a new ast.File, shown below, that dot-imports the
    // original "cooked" package using a special name ("·this·"), so that all
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 11.2K bytes
    - Viewed (0)
  6. src/internal/trace/testdata/testprog/stress-start-stop.go

    		go func() {
    			runtime.LockOSThread()
    			for {
    				select {
    				case <-done:
    					return
    				default:
    					runtime.Gosched()
    				}
    			}
    		}()
    
    		runtime.GC()
    		// Trigger GC from malloc.
    		n := 512
    		for i := 0; i < n; i++ {
    			_ = make([]byte, 1<<20)
    		}
    
    		// Create a bunch of busy goroutines to load all Ps.
    		for p := 0; p < 10; p++ {
    			wg.Add(1)
    			go func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/utils/string_utils.cc

      int32_t bytes = data_.size()                            // size of content
                      + sizeof(int32_t) * (num_strings + 2);  // size of header
      // Caller will take ownership of buffer.
      *buffer = reinterpret_cast<char*>(malloc(bytes));
    
      if (*buffer == nullptr) {
        return -1;
      }
    
      // Set num of string
      //
      // NOTE: The string buffer is accessed here as if it's native endian (instead
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Jun 12 21:41:49 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  8. tensorflow/c/c_test.c

      }
    
      char file_name[100];
      time_t t = time(NULL);
      snprintf(file_name, sizeof(file_name), "test-%d-%ld.txt", getpid(), t);
    
      size_t length = 2 + strlen(path) + strlen(file_name);
      char* full_path = malloc(length);
      snprintf(full_path, length, "%s/%s", path, file_name);
    
      TF_WritableFileHandle* h;
      TF_Status* status = TF_NewStatus();
      TF_NewWritableFile(full_path, &h, status);
      if (TF_GetCode(status) != TF_OK) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 24 20:50:35 UTC 2024
    - 2.8K bytes
    - Viewed (0)
  9. src/syscall/exec_libc.go

    // they might have been locked at the time of the fork. This means
    // no rescheduling, no malloc calls, and no new stack segments.
    //
    // We call hand-crafted syscalls, implemented in
    // ../runtime/syscall_solaris.go, rather than generated libc wrappers
    // because we need to avoid lazy-loading the functions (might malloc,
    // split the stack, or acquire mutexes). We can't call RawSyscall
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 29 18:51:35 UTC 2023
    - 8.2K bytes
    - Viewed (0)
  10. src/cmd/cgo/internal/test/test.go

    	// nothing to run, just make sure this compiles.
    	_ = C.X
    }
    
    // issue 6390
    
    func test6390(t *testing.T) {
    	p1 := C.malloc(1024)
    	if p1 == nil {
    		t.Fatalf("C.malloc(1024) returned nil")
    	}
    	p2 := C.malloc(0)
    	if p2 == nil {
    		t.Fatalf("C.malloc(0) returned nil")
    	}
    	C.free(p1)
    	C.free(p2)
    }
    
    func test6472() {
    	// nothing to run, just make sure this compiles
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 15:50:06 UTC 2024
    - 48.5K bytes
    - Viewed (0)
Back to top