Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 168 for Malloc (0.13 sec)

  1. src/cmd/cgo/internal/testerrors/ptr_test.go

    		c: `#include <stdlib.h>
    		    char **f14a() { return malloc(sizeof(char*)); }
    		    void f14b(char **p) {}`,
    		body:      `p := C.f14a(); *p = new(C.char); C.f14b(p)`,
    		fail:      true,
    		expensive: true,
    	},
    	{
    		// Storing a pinned Go pointer into C memory should succeed.
    		name: "barrierpinnedok",
    		c: `#include <stdlib.h>
    		    char **f14a2() { return malloc(sizeof(char*)); }
    		    void f14b2(char **p) {}`,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 03 16:07:49 UTC 2023
    - 21.2K bytes
    - Viewed (0)
  2. tensorflow/c/eager/c_api_experimental.cc

    }
    
    const void TFE_MonitoringStringGaugeCellValue(
        TFE_MonitoringStringGaugeCell* cell, TF_Buffer* buf) {
      tensorflow::string value = cell->cell.value();
      void* data = tensorflow::port::Malloc(value.length());
      value.copy(static_cast<char*>(data), value.length(), 0);
      buf->data = data;
      buf->length = value.length();
      buf->data_deallocator = [](void* data, size_t length) {
        tensorflow::port::Free(data);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 11 23:52:39 UTC 2024
    - 35.9K bytes
    - Viewed (0)
  3. src/runtime/runtime1.go

    	profstackdepth           int32
    
    	// debug.malloc is used as a combined debug check
    	// in the malloc function and should be set
    	// if any of the below debug options is != 0.
    	malloc    bool
    	inittrace int32
    	sbrk      int32
    	// traceallocfree controls whether execution traces contain
    	// detailed trace data about memory allocation. This value
    	// affects debug.malloc only if it is != 0 and the execution
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:52:17 UTC 2024
    - 19.3K bytes
    - Viewed (0)
  4. src/runtime/mcache.go

    var emptymspan mspan
    
    func allocmcache() *mcache {
    	var c *mcache
    	systemstack(func() {
    		lock(&mheap_.lock)
    		c = (*mcache)(mheap_.cachealloc.alloc())
    		c.flushGen.Store(mheap_.sweepgen)
    		unlock(&mheap_.lock)
    	})
    	for i := range c.alloc {
    		c.alloc[i] = &emptymspan
    	}
    	c.nextSample = nextSample()
    	return c
    }
    
    // freemcache releases resources associated with this
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 10K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. 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)
  8. src/cmd/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go

    	{"kern.hostid", []_C_int{1, 11}},
    	{"kern.hostname", []_C_int{1, 10}},
    	{"kern.intrcnt.nintrcnt", []_C_int{1, 63, 1}},
    	{"kern.job_control", []_C_int{1, 19}},
    	{"kern.malloc.buckets", []_C_int{1, 39, 1}},
    	{"kern.malloc.kmemnames", []_C_int{1, 39, 3}},
    	{"kern.maxclusters", []_C_int{1, 67}},
    	{"kern.maxfiles", []_C_int{1, 7}},
    	{"kern.maxlocksperuid", []_C_int{1, 70}},
    	{"kern.maxpartitions", []_C_int{1, 23}},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 11.9K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go

    	{"kern.hostid", []_C_int{1, 11}},
    	{"kern.hostname", []_C_int{1, 10}},
    	{"kern.intrcnt.nintrcnt", []_C_int{1, 63, 1}},
    	{"kern.job_control", []_C_int{1, 19}},
    	{"kern.malloc.buckets", []_C_int{1, 39, 1}},
    	{"kern.malloc.kmemnames", []_C_int{1, 39, 3}},
    	{"kern.maxclusters", []_C_int{1, 67}},
    	{"kern.maxfiles", []_C_int{1, 7}},
    	{"kern.maxlocksperuid", []_C_int{1, 70}},
    	{"kern.maxpartitions", []_C_int{1, 23}},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 11.9K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/sys/unix/zsysctl_openbsd_ppc64.go

    	{"kern.hostid", []_C_int{1, 11}},
    	{"kern.hostname", []_C_int{1, 10}},
    	{"kern.intrcnt.nintrcnt", []_C_int{1, 63, 1}},
    	{"kern.job_control", []_C_int{1, 19}},
    	{"kern.malloc.buckets", []_C_int{1, 39, 1}},
    	{"kern.malloc.kmemnames", []_C_int{1, 39, 3}},
    	{"kern.maxclusters", []_C_int{1, 67}},
    	{"kern.maxfiles", []_C_int{1, 7}},
    	{"kern.maxlocksperuid", []_C_int{1, 70}},
    	{"kern.maxpartitions", []_C_int{1, 23}},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 11.9K bytes
    - Viewed (0)
Back to top