Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 467 for nelem (0.1 sec)

  1. src/testing/fstest/mapfs.go

    		for fname, f := range fsys {
    			if strings.HasPrefix(fname, prefix) {
    				felem := fname[len(prefix):]
    				i := strings.Index(felem, "/")
    				if i < 0 {
    					list = append(list, mapFileInfo{felem, f})
    				} else {
    					need[fname[len(prefix):len(prefix)+i]] = true
    				}
    			}
    		}
    		// If the directory name is not in the map,
    		// and there are no children of the name in the map,
    		// then the directory is treated as not existing.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  2. src/runtime/mgcsweep.go

    		// more detail.
    		print("runtime: nelems=", s.nelems, " nalloc=", nalloc, " previous allocCount=", s.allocCount, " nfreed=", nfreed, "\n")
    		throw("sweep increased allocation count")
    	}
    
    	s.allocCount = nalloc
    	s.freeindex = 0 // reset allocation index to start of span.
    	s.freeIndexForScan = 0
    	if traceEnabled() {
    		getg().m.p.ptr().trace.reclaimed += uintptr(nfreed) * s.elemsize
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:52:18 UTC 2024
    - 32.9K bytes
    - Viewed (0)
  3. test/typeparam/chansimp.dir/a.go

    // until c is closed or the context is canceled, at which point the
    // returned channel is closed.
    func Filter[Elem any](ctx context.Context, c <-chan Elem, f func(Elem) bool) <-chan Elem {
    	r := make(chan Elem)
    	go func(ctx context.Context, c <-chan Elem, f func(Elem) bool, r chan<- Elem) {
    		defer close(r)
    		for {
    			select {
    			case <-ctx.Done():
    				return
    			case v, ok := <-c:
    				if !ok {
    					return
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jul 28 21:40:40 UTC 2021
    - 5.5K bytes
    - Viewed (0)
  4. test/typeparam/ordered.go

    		~float32 | ~float64 |
    		~string
    }
    
    type orderedSlice[Elem Ordered] []Elem
    
    func (s orderedSlice[Elem]) Len() int { return len(s) }
    func (s orderedSlice[Elem]) Less(i, j int) bool {
    	if s[i] < s[j] {
    		return true
    	}
    	isNaN := func(f Elem) bool { return f != f }
    	if isNaN(s[i]) && !isNaN(s[j]) {
    		return true
    	}
    	return false
    }
    func (s orderedSlice[Elem]) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 2.2K bytes
    - Viewed (0)
  5. test/typeparam/chans.go

    // until c is closed or the context is canceled, at which point the
    // returned channel is closed.
    func _Filter[Elem any](ctx context.Context, c <-chan Elem, f func(Elem) bool) <-chan Elem {
    	r := make(chan Elem)
    	go func(ctx context.Context, c <-chan Elem, f func(Elem) bool, r chan<- Elem) {
    		defer close(r)
    		for {
    			select {
    			case <-ctx.Done():
    				return
    			case v, ok := <-c:
    				if !ok {
    					return
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 8.4K bytes
    - Viewed (0)
  6. src/runtime/debug/mod.go

    		newline   = "\n"
    		tab       = "\t"
    	)
    
    	readModuleLine := func(elem []string) (Module, error) {
    		if len(elem) != 2 && len(elem) != 3 {
    			return Module{}, fmt.Errorf("expected 2 or 3 columns; got %d", len(elem))
    		}
    		version := elem[1]
    		sum := ""
    		if len(elem) == 3 {
    			sum = elem[2]
    		}
    		return Module{
    			Path:    elem[0],
    			Version: version,
    			Sum:     sum,
    		}, nil
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 25 15:06:51 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  7. schema/utils.go

    	case reflect.Slice, reflect.Array:
    		for i := 0; i < reflectValue.Len(); i++ {
    			elem := reflectValue.Index(i)
    			elemKey := elem.Interface()
    			if elem.Kind() != reflect.Ptr && elem.CanAddr() {
    				elemKey = elem.Addr().Interface()
    			}
    
    			if _, ok := loaded[elemKey]; ok {
    				continue
    			}
    			loaded[elemKey] = true
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sat Aug 19 13:35:14 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  8. test/typeparam/sets.go

    // _Make makes a new set.
    func _Make[Elem comparable]() _Set[Elem] {
    	return _Set[Elem]{m: make(map[Elem]struct{})}
    }
    
    // Add adds an element to a set.
    func (s _Set[Elem]) Add(v Elem) {
    	s.m[v] = struct{}{}
    }
    
    // Delete removes an element from a set. If the element is not present
    // in the set, this does nothing.
    func (s _Set[Elem]) Delete(v Elem) {
    	delete(s.m, v)
    }
    
    // Contains reports whether v is in the set.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 5.7K bytes
    - Viewed (0)
  9. test/typeparam/sliceimp.dir/a.go

    func Filter[Elem any](s []Elem, f func(Elem) bool) []Elem {
    	var r []Elem
    	for _, v := range s {
    		if f(v) {
    			r = append(r, v)
    		}
    	}
    	return r
    }
    
    // Max returns the maximum element in a slice of some ordered type.
    // If the slice is empty it returns the zero value of the element type.
    func SliceMax[Elem Ordered](s []Elem) Elem {
    	if len(s) == 0 {
    		var zero Elem
    		return zero
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 30 01:55:58 UTC 2021
    - 3.3K bytes
    - Viewed (0)
  10. test/fixedbugs/issue53702.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    type Elem struct{}
    
    func (*Elem) Wait(callback func()) {}
    
    type Base struct {
    	elem [8]*Elem
    }
    
    var g_val = 1
    
    func (s *Base) Do() *int {
    	resp := &g_val
    	for _, e := range s.elem {
    		e.Wait(func() {
    			*resp = 0
    		})
    	}
    	return resp
    }
    
    type Sub struct {
    	*Base
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Aug 14 00:14:04 UTC 2022
    - 551 bytes
    - Viewed (0)
Back to top