Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. src/syscall/exec_libc2.go

    // (Pipe is close-on-exec so if exec succeeds, it will be closed.)
    // In the child, this function must not acquire any locks, because
    // they might have been locked at the time of the fork. This means
    // no rescheduling, no malloc calls, and no new stack segments.
    // For the same reason compiler does not race instrument it.
    // The calls to rawSyscall are okay because they are assembly
    // functions that do not grow the stack.
    //
    //go:norace
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 29 18:51:35 UTC 2023
    - 8.2K bytes
    - Viewed (0)
  2. src/strings/builder_test.go

    		}
    	})
    }
    
    func TestBuilderGrowSizeclasses(t *testing.T) {
    	s := Repeat("a", 19)
    	allocs := testing.AllocsPerRun(100, func() {
    		var b Builder
    		b.Grow(18)
    		b.WriteString(s)
    		_ = b.String()
    	})
    	if allocs > 1 {
    		t.Fatalf("unexpected amount of allocations: %v, want: 1", allocs)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 19 19:51:15 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  3. src/runtime/pprof/protomem_test.go

    		}
    	}
    }
    
    type opAlloc struct {
    	buf [128]byte
    }
    
    type opCall struct {
    }
    
    var sink []byte
    
    func storeAlloc() {
    	sink = make([]byte, 16)
    }
    
    func nonRecursiveGenericAllocFunction[CurrentOp any, OtherOp any](alloc bool) {
    	if alloc {
    		storeAlloc()
    	} else {
    		nonRecursiveGenericAllocFunction[OtherOp, CurrentOp](true)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 21 14:38:45 UTC 2024
    - 6.7K bytes
    - Viewed (0)
  4. src/log/slog/value_test.go

    		tm = TimeValue(testTime).Time()
    		x = AnyValue(p).Any()
    	}))
    	if a != 0 {
    		t.Errorf("got %d allocs, want zero", a)
    	}
    	_ = u
    	_ = f
    	_ = b
    	_ = s
    	_ = x
    	_ = tm
    }
    
    func TestAnyLevelAlloc(t *testing.T) {
    	// Because typical Levels are small integers,
    	// they are zero-alloc.
    	var a Value
    	x := LevelDebug + 100
    	wantAllocs(t, 0, func() { a = AnyValue(x) })
    	_ = a
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:12:08 UTC 2024
    - 6.9K bytes
    - Viewed (0)
  5. src/runtime/mem_windows.go

    	// VirtualAlloc calls, and Windows will only let each VirtualFree handle pages from
    	// a single VirtualAlloc. It is okay to specify a subset of the pages from a single alloc,
    	// just not pages from multiple allocs. This is a rare case, arising only when we're
    	// trying to give memory back to the operating system, which happens on a time
    	// scale of minutes. It doesn't have to be terribly fast. Instead of extra bookkeeping
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 22 19:05:10 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  6. test/escape4.go

    package foo
    
    var p *int
    
    func alloc(x int) *int { // ERROR "can inline alloc" "moved to heap: x"
    	return &x
    }
    
    var f func()
    
    func f1() {
    	p = alloc(2) // ERROR "inlining call to alloc" "moved to heap: x"
    
    	// Escape analysis used to miss inlined code in closures.
    
    	func() { // ERROR "can inline f1.func1"
    		p = alloc(3) // ERROR "inlining call to alloc"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 14 19:43:26 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  7. pkg/registry/core/service/allocator/storage/storage.go

    	var once sync.Once
    	return &Etcd{
    		alloc:     alloc,
    		storage:   storage,
    		baseKey:   baseKey,
    		resource:  config.GroupResource,
    		destroyFn: func() { once.Do(d) },
    	}, nil
    }
    
    // Allocate attempts to allocate the item.
    func (e *Etcd) Allocate(offset int) (bool, error) {
    	e.lock.Lock()
    	defer e.lock.Unlock()
    
    	err := e.tryUpdate(func() error {
    		ok, err := e.alloc.Allocate(offset)
    		if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 24 09:23:05 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  8. pkg/registry/core/service/portallocator/allocator.go

    	}
    	return r, nil
    }
    
    // Free returns the count of port left in the range.
    func (r *PortAllocator) Free() int {
    	return r.alloc.Free()
    }
    
    // Used returns the count of ports used in the range.
    func (r *PortAllocator) Used() int {
    	return r.portRange.Size - r.alloc.Free()
    }
    
    // Allocate attempts to reserve the provided port. ErrNotInRange or
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 08 07:15:02 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  9. test/fixedbugs/issue15277.go

    	if delta := inuse() - start; delta < 9<<20 {
    		println("after alloc: expected delta at least 9MB, got: ", delta)
    	}
    	runtime.KeepAlive(x)
    	x = nil
    	if delta := inuse() - start; delta > 1<<20 {
    		println("after drop: expected delta below 1MB, got: ", delta)
    	}
    	x = new(big)
    	if delta := inuse() - start; delta < 9<<20 {
    		println("second alloc: expected delta at least 9MB, got: ", delta)
    	}
    	runtime.KeepAlive(x)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 851 bytes
    - Viewed (0)
  10. src/runtime/traceregion.go

    // alloc allocates n-byte block. The block is always aligned to 8 bytes, regardless of platform.
    func (a *traceRegionAlloc) alloc(n uintptr) *notInHeap {
    	n = alignUp(n, 8)
    	if n > traceRegionAllocBlockData {
    		throw("traceRegion: alloc too large")
    	}
    	if a.dropping.Load() {
    		throw("traceRegion: alloc with concurrent drop")
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:47:01 UTC 2024
    - 3.2K bytes
    - Viewed (0)
Back to top