Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 363 for Malloc (0.33 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. src/cmd/cgo/internal/testerrors/testdata/err2.go

    typedef void v;
    void F(v** p) {}
    
    void fvi(void *p, int x) {}
    
    void fppi(int** p) {}
    
    int i;
    void fi(int i) {}
    */
    import "C"
    import (
    	"unsafe"
    )
    
    func main() {
    	s := ""
    	_ = s
    	C.malloc(s) // ERROR HERE
    
    	x := (*C.bar_t)(nil)
    	C.foop = x // ERROR HERE
    
    	// issue 13129: used to output error about C.unsignedshort with CC=clang
    	var x1 C.ushort
    	x1 = int(0) // ERROR HERE: C\.ushort
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  6. src/strconv/strconv_test.go

    		Buffer: make([]byte, 1024),
    	}
    
    	checkNoAllocs := func(f func()) func(t *testing.T) {
    		return func(t *testing.T) {
    			t.Helper()
    			if allocs := testing.AllocsPerRun(runsPerTest, f); allocs != 0 {
    				t.Errorf("got %v allocs, want 0 allocs", allocs)
    			}
    		}
    	}
    
    	t.Run("Atoi", checkNoAllocs(func() {
    		Sink.Int, Sink.Error = Atoi(string(bytes.Number))
    	}))
    	t.Run("ParseBool", checkNoAllocs(func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 23 20:29:22 UTC 2022
    - 4.7K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top