Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 363 for Malloc (0.14 sec)

  1. 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)
  2. 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)
  3. src/cmd/cgo/internal/testsanitizers/testdata/msan_fail.go

    // license that can be found in the LICENSE file.
    
    package main
    
    /*
    #include <string.h>
    #include <stdint.h>
    #include <stdlib.h>
    
    void f(int32_t *p, int n) {
      int32_t * volatile q = (int32_t *)malloc(sizeof(int32_t) * n);
      memcpy(p, q, n * sizeof(*p));
      free(q);
    }
    
    void g(int32_t *p, int n) {
      if (p[4] != 1) {
        // We shouldn't get here; msan should stop us first.
        exit(0);
      }
    }
    */
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 701 bytes
    - Viewed (0)
  4. src/cmd/cgo/out.go

    const char *_cgoPREFIX_Cfunc_CString(struct __go_string s) {
    	char *p = malloc(s.__length+1);
    	if(p == NULL)
    		runtime_throw("runtime: C malloc failed");
    	memmove(p, s.__data, s.__length);
    	p[s.__length] = 0;
    	return p;
    }
    
    void *_cgoPREFIX_Cfunc_CBytes(struct __go_open_array b) {
    	char *p = malloc(b.__count);
    	if(p == NULL)
    		runtime_throw("runtime: C malloc failed");
    	memmove(p, b.__values, b.__count);
    	return p;
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 29 16:41:10 UTC 2024
    - 59.6K bytes
    - Viewed (0)
  5. src/cmd/cgo/internal/testsanitizers/testdata/tsan15.go

    static void *sendthr(void *arg) {
    	pthread_t th = *(pthread_t*)arg;
    	while (1) {
    		int r = pthread_kill(th, SIGWINCH);
    		if (r < 0)
    			break;
    	}
    	return 0;
    }
    
    static void foo() {
    	pthread_t *th = malloc(sizeof(pthread_t));
    	pthread_t th2;
    	pthread_create(th, 0, thr, 0);
    	pthread_create(&th2, 0, sendthr, th);
    	pthread_join(*th, 0);
    }
    */
    import "C"
    
    import (
    	"time"
    )
    
    //export go_callback
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 06 21:14:49 UTC 2024
    - 968 bytes
    - Viewed (0)
  6. src/cmd/cgo/internal/testsanitizers/testdata/tsan13.go

    }
    
    static void* spin(void *arg) {
    	size_t n;
    	struct timeval tvstart, tvnow;
    	int diff;
    	void *prev;
    	void *cur;
    
    	prev = NULL;
    	gettimeofday(&tvstart, NULL);
    	for (n = 0; n < 1<<20; n++) {
    		cur = malloc(n);
    		free(prev);
    		prev = cur;
    
    		gettimeofday(&tvnow, NULL);
    		diff = (tvnow.tv_sec - tvstart.tv_sec) * 1000 * 1000 + (tvnow.tv_usec - tvstart.tv_usec);
    
    		// Profile frequency is 100Hz so we should definitely
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. 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)
  10. src/cmd/cgo/internal/testsanitizers/testdata/tsan9.go

    #include <stdlib.h>
    #include <sys/time.h>
    
    void spin() {
    	size_t n;
    	struct timeval tvstart, tvnow;
    	int diff;
    	void *prev = NULL, *cur;
    
    	gettimeofday(&tvstart, NULL);
    	for (n = 0; n < 1<<20; n++) {
    		cur = malloc(n);
    		free(prev);
    		prev = cur;
    
    		gettimeofday(&tvnow, NULL);
    		diff = (tvnow.tv_sec - tvstart.tv_sec) * 1000 * 1000 + (tvnow.tv_usec - tvstart.tv_usec);
    
    		// Profile frequency is 100Hz so we should definitely
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 1.3K bytes
    - Viewed (0)
Back to top