Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 133 for newB (0.33 sec)

  1. test/fixedbugs/issue59680.go

    // license that can be found in the LICENSE file.
    
    package main
    
    import (
    	"sync"
    	"time"
    )
    
    type B struct {
    	pid int
    	f   func() (uint64, error)
    	wg  sync.WaitGroup
    	v   uint64
    }
    
    func newB(pid int) *B {
    	return &B{
    		pid: pid,
    	}
    }
    
    //go:noinline
    func Sq(i int) uint64 {
    	S++
    	return uint64(i * i)
    }
    
    type RO func(*B)
    
    var ROSL = []RO{
    	Bad(),
    }
    
    func Bad() RO {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 05 21:04:38 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  2. src/internal/fuzz/encoding_test.go

    			}
    			if err != nil {
    				t.Fatalf("unmarshal unexpected error: %v", err)
    			}
    			newB := marshalCorpusFile(vals...)
    			if newB[len(newB)-1] != '\n' {
    				t.Error("didn't write final newline to corpus file")
    			}
    
    			want := test.want
    			if want == "" {
    				want = test.in
    			}
    			want += "\n"
    			got := string(newB)
    			if got != want {
    				t.Errorf("unexpected marshaled value\ngot:\n%s\nwant:\n%s", got, want)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 00:20:34 UTC 2024
    - 8.2K bytes
    - Viewed (0)
  3. src/runtime/mgcwork.go

    			}
    			// Record the new span in the busy list.
    			lock(&work.wbufSpans.lock)
    			work.wbufSpans.busy.insert(s)
    			unlock(&work.wbufSpans.lock)
    		}
    		// Slice up the span into new workbufs. Return one and
    		// put the rest on the empty list.
    		for i := uintptr(0); i+_WorkbufSize <= workbufAlloc; i += _WorkbufSize {
    			newb := (*workbuf)(unsafe.Pointer(s.base() + i))
    			newb.nobj = 0
    			lfnodeValidate(&newb.node)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 12.9K bytes
    - Viewed (0)
  4. src/runtime/map.go

    	}
    
    	if inserti == nil {
    		// The current bucket and all the overflow buckets connected to it are full, allocate a new one.
    		newb := h.newoverflow(t, b)
    		inserti = &newb.tophash[0]
    		insertk = add(unsafe.Pointer(newb), dataOffset)
    		elem = add(insertk, abi.MapBucketCount*uintptr(t.KeySize))
    	}
    
    	// store new key/elem at insert position
    	if t.IndirectKey() {
    		kmem := newobject(t.Key)
    		*(*unsafe.Pointer)(insertk) = kmem
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 57.6K bytes
    - Viewed (0)
  5. test/typeparam/issue50598.dir/a0.go

    // license that can be found in the LICENSE file.
    
    package a0
    
    type Builder[T any] struct{}
    
    func (r Builder[T]) New1() T {
    	var v T
    	return v
    }
    
    func (r Builder[T]) New2() T {
    	var v T
    	return v
    }
    
    type IntBuilder struct{}
    
    func (b IntBuilder) New() int {
    	return Builder[int]{}.New2()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 14 16:41:18 UTC 2022
    - 398 bytes
    - Viewed (0)
  6. staging/src/k8s.io/apimachinery/pkg/runtime/extension_test.go

    			t.Errorf("2nd unmarshal error: %v", err)
    		}
    		if !bytes.Equal(data, newData) {
    			t.Errorf("%s: re-marshaled data differs from original: %v %v", k, data, newData)
    		}
    		if !reflect.DeepEqual(tc.orig, new1) {
    			t.Errorf("%s: unmarshaled struct differs from original: %v %v", k, tc.orig, new1)
    		}
    		if !reflect.DeepEqual(new1, new2) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 08 22:36:37 UTC 2017
    - 2.8K bytes
    - Viewed (0)
  7. src/runtime/iface.go

    	newN := n * 2                         // make it at most 50% full
    	newN = 1 << sys.Len64(uint64(newN-1)) // round up to a power of 2
    
    	// Allocate the new table.
    	newSize := unsafe.Sizeof(abi.TypeAssertCache{}) + uintptr(newN-1)*unsafe.Sizeof(abi.TypeAssertCacheEntry{})
    	newC := (*abi.TypeAssertCache)(mallocgc(newSize, nil, true))
    	newC.Mask = uintptr(newN - 1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 22.5K bytes
    - Viewed (0)
  8. tests/named_argument_test.go

    	if err := DB.Exec("UPDATE named_users SET name1 = @name, name2 = @name2, name3 = @name", sql.Named("name", "jinzhu-new"), sql.Named("name2", "jinzhu-new2")).Error; err != nil {
    		t.Errorf("failed to update with named arg")
    	}
    
    	namedUser.Name1 = "jinzhu-new"
    	namedUser.Name2 = "jinzhu-new2"
    	namedUser.Name3 = "jinzhu-new"
    
    	var result5 NamedUser
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Tue Dec 21 11:50:00 UTC 2021
    - 2.7K bytes
    - Viewed (0)
  9. tests/hooks_test.go

    	DB.Model(&product).Updates(map[string]interface{}{"Name": "Product New"})
    
    	if product.Name != "Product New" || product.Price != 160 || product.Code != "L1212" {
    		t.Errorf("invalid data after update, got %+v", product)
    	}
    
    	// Code changed, but not selected, price should not change
    	DB.Model(&product).Select("Name", "Price").Updates(map[string]interface{}{"Name": "Product New2", "code": "L1213"})
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sat Feb 18 01:20:29 UTC 2023
    - 15.9K bytes
    - Viewed (0)
  10. internal/grid/types.go

    	ePool sync.Pool // Elements
    }
    
    // NewArrayOf returns a new ArrayOf.
    // You must provide a function that returns a new instance of T.
    func NewArrayOf[T RoundTripper](newFn func() T) *ArrayOf[T] {
    	return &ArrayOf[T]{
    		ePool: sync.Pool{New: func() any {
    			return newFn()
    		}},
    	}
    }
    
    // New returns a new empty Array.
    func (p *ArrayOf[T]) New() *Array[T] {
    	return &Array[T]{
    		p: p,
    	}
    }
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Apr 01 23:42:09 UTC 2024
    - 15.4K bytes
    - Viewed (0)
Back to top