Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 224 for Malloc (0.18 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. tensorflow/compiler/mlir/quantization/tensorflow/debugging/mlir_dump_test.cc

      mlir::OpBuilder builder(&ctx);
      auto module_op = builder.create<mlir::ModuleOp>(builder.getUnknownLoc());
      // Destroy by calling destroy() to avoid memory leak since it is allocated
      // with malloc().
      const absl::Cleanup module_op_cleanup = [module_op] { module_op->destroy(); };
    
      const mlir::LogicalResult result = pm.run(module_op);
      EXPECT_FALSE(failed(result));
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Feb 14 03:17:14 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  8. 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)
  9. src/runtime/arena.go

    	}
    
    	// Prevent preemption as we set up the space for a new object.
    	//
    	// Act like we're allocating.
    	mp := acquirem()
    	if mp.mallocing != 0 {
    		throw("malloc deadlock")
    	}
    	if mp.gsignal == getg() {
    		throw("malloc during signal")
    	}
    	mp.mallocing = 1
    
    	var ptr unsafe.Pointer
    	if !typ.Pointers() {
    		// Allocate pointer-less objects from the tail end of the chunk.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:44:56 UTC 2024
    - 37.9K bytes
    - Viewed (0)
  10. tensorflow/c/tf_tensor.h

    // memory is allocated to pass the Tensor to the C API. The allocated memory
    // satisfies TensorFlow's memory alignment preferences and should be preferred
    // over calling malloc and free.
    //
    // The caller must set the Tensor values by writing them to the pointer returned
    // by TF_TensorData with length TF_TensorByteSize.
    TF_CAPI_EXPORT extern TF_Tensor* TF_AllocateTensor(TF_DataType,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Mar 06 16:40:30 UTC 2024
    - 6.3K bytes
    - Viewed (0)
Back to top