Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 195 for Malloc (0.12 sec)

  1. src/syscall/mksysctl_openbsd.pl

    # We then walk this MIB and create a flattened sysctl name to OID hash.
    #
    
    use strict;
    
    my $debug = 0;
    my %ctls = ();
    
    my @headers = qw (
    	sys/sysctl.h
    	sys/socket.h
    	sys/tty.h
    	sys/malloc.h
    	sys/mount.h
    	sys/namei.h
    	sys/sem.h
    	sys/shm.h
    	sys/vmmeter.h
    	uvm/uvm_param.h
    	uvm/uvm_swap_encrypt.h
    	ddb/db_var.h
    	net/if.h
    	net/if_pfsync.h
    	net/pipex.h
    	netinet/in.h
    	netinet/icmp_var.h
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 14 13:21:46 UTC 2018
    - 5K bytes
    - Viewed (0)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. src/cmd/cgo/internal/testsanitizers/testdata/msan6.go

    #cgo LDFLAGS: -fsanitize=memory
    #cgo CPPFLAGS: -fsanitize=memory
    
    #include <stdint.h>
    #include <stdlib.h>
    #include <string.h>
    
    typedef struct {
    	uintptr_t a[20];
    } S;
    
    S f() {
    	S *p;
    
    	p = (S *)(malloc(sizeof(S)));
    	p->a[0] = 0;
    	return *p;
    }
    */
    import "C"
    
    // allocateStack extends the stack so that stack copying doesn't
    // confuse the msan data structures.
    //
    //go:noinline
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  8. src/encoding/gob/timing_test.go

    		}
    	})
    	if allocs != 0 {
    		t.Fatalf("mallocs per encode of type Bench: %v; wanted 0\n", allocs)
    	}
    }
    
    func TestCountDecodeMallocs(t *testing.T) {
    	if testing.Short() {
    		t.Skip("skipping malloc count in short mode")
    	}
    	if runtime.GOMAXPROCS(0) > 1 {
    		t.Skip("skipping; GOMAXPROCS>1")
    	}
    
    	const N = 1000
    
    	var buf bytes.Buffer
    	enc := NewEncoder(&buf)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 04 07:16:59 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  9. test/fixedbugs/issue47185.dir/bad/bad.go

    		len(a.B.C1.D2.E2.F7) != 0 ||
    		len(a.B.C1.D2.E2.F8) != 0 ||
    		len(a.B.C1.D2.E2.F9) != 0 ||
    		len(a.B.C1.D2.E2.F10) != 0 ||
    		len(a.B.C1.D2.E2.F11) != 0 ||
    		len(a.B.C1.D2.E2.F16) != 0 {
    		panic("bad")
    	}
    	C.malloc(100)
    }
    
    type A struct {
    	B
    }
    
    type B struct {
    	C1 C
    	C2 C
    }
    
    type C struct {
    	D1 D
    	D2 D
    }
    
    type D struct {
    	E1 E
    	E2 E
    	E3 E
    	E4 E
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jul 19 13:27:46 UTC 2021
    - 1.1K bytes
    - Viewed (0)
  10. 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)
Back to top