Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 163 for Malloc (0.1 sec)

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

    			}
    		})
    	}
    }
    
    func TestMallocCrashesOnNil(t *testing.T) {
    	testenv.MustHaveCGO(t)
    	testenv.MustHaveGoRun(t)
    	t.Parallel()
    
    	cmd := exec.Command("go", "run", path("malloc.go"))
    	out, err := cmd.CombinedOutput()
    	if err == nil {
    		t.Logf("%#q:\n%s", strings.Join(cmd.Args, " "), out)
    		t.Fatalf("succeeded unexpectedly")
    	}
    }
    
    func TestNotMatchedCFunction(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 15:50:06 UTC 2024
    - 4K bytes
    - Viewed (0)
  5. tensorflow/c/experimental/stream_executor/stream_executor_test.cc

      se_.allocate = [](const SP_Device* const device, uint64_t size,
                        int64_t memory_space, SP_DeviceMemoryBase* const mem) {
        mem->struct_size = SP_DEVICE_MEMORY_BASE_STRUCT_SIZE;
        mem->opaque = malloc(size);
        mem->size = size;
      };
      se_.deallocate = [](const SP_Device* const device,
                          SP_DeviceMemoryBase* const mem) {
        EXPECT_EQ(mem->size, 2 * sizeof(int));
        free(mem->opaque);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon May 20 19:54:04 UTC 2024
    - 26.5K bytes
    - Viewed (0)
  6. src/runtime/mbitmap.go

    	"runtime/internal/sys"
    	"unsafe"
    )
    
    const (
    	// A malloc header is functionally a single type pointer, but
    	// we need to use 8 here to ensure 8-byte alignment of allocations
    	// on 32-bit platforms. It's wasteful, but a lot of code relies on
    	// 8-byte alignment for 8-byte atomics.
    	mallocHeaderSize = 8
    
    	// The minimum object size that has a malloc header, exclusive.
    	//
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 60K bytes
    - Viewed (0)
  7. src/runtime/trace.go

    		// Finish off CPU profile reading.
    		traceStopReadCPU()
    
    		// Reset debug.malloc if necessary. Note that this is set in a racy
    		// way; that's OK. Some mallocs may still enter into the debug.malloc
    		// block, but they won't generate events because tracing is disabled.
    		// That is, it's OK if mallocs read a stale debug.malloc or
    		// trace.enabledWithAllocFree value.
    		if trace.enabledWithAllocFree {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 37.1K bytes
    - Viewed (0)
  8. src/runtime/mksizeclasses.go

    // Copyright 2016 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    //go:build ignore
    
    // Generate tables for small malloc size classes.
    //
    // See malloc.go for overview.
    //
    // The size classes are chosen so that rounding an allocation
    // request up to the next size class wastes at most 12.5% (1.125x).
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 20:31:27 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  9. src/runtime/panic.go

    //go:nowritebarrierrec
    func startpanic_m() bool {
    	gp := getg()
    	if mheap_.cachealloc.size == 0 { // very early
    		print("runtime: panic before malloc heap initialized\n")
    	}
    	// Disallow malloc during an unrecoverable panic. A panic
    	// could happen in a signal handler, or in a throw, or inside
    	// malloc itself. We want to catch if an allocation ever does
    	// happen (even if we're not in one of these situations).
    	gp.m.mallocing++
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 43.8K bytes
    - Viewed (0)
  10. src/cmd/cgo/doc.go

    	func C.GoBytes(unsafe.Pointer, C.int) []byte
    
    As a special case, C.malloc does not call the C library malloc directly
    but instead calls a Go helper function that wraps the C library malloc
    but guarantees never to return nil. If C's malloc indicates out of memory,
    the helper function crashes the program, like when Go itself runs out
    of memory. Because C.malloc cannot fail, it has no two-result form
    that returns errno.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 17:12:16 UTC 2024
    - 42.2K bytes
    - Viewed (0)
Back to top