Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 1,076 for fallocate (0.18 sec)

  1. pkg/registry/core/service/portallocator/allocator_test.go

    	if err := r.Release(released); err != nil {
    		t.Fatal(err)
    	}
    
    	err = r.Allocate(1)
    	if _, ok := err.(*ErrNotInRange); !ok {
    		t.Fatal(err)
    	}
    
    	if err := r.Allocate(10001); err != ErrAllocated {
    		t.Fatal(err)
    	}
    
    	err = r.Allocate(20000)
    	if _, ok := err.(*ErrNotInRange); !ok {
    		t.Fatal(err)
    	}
    
    	err = r.Allocate(10201)
    	if _, ok := err.(*ErrNotInRange); !ok {
    		t.Fatal(err)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 08 07:15:02 UTC 2024
    - 14K bytes
    - Viewed (0)
  2. pkg/registry/core/service/ipallocator/bitmap_test.go

    		if !r.Has(netutils.ParseIPSloppy(ip)) {
    			t.Errorf("IP %s expected to be allocated", ip)
    		}
    	}
    	if f := r.Free(); f != dynamicOffset {
    		t.Errorf("expected %d free addresses, got %d", dynamicOffset, f)
    	}
    	// allocate all addresses on the static block
    	for i := 0; i < dynamicOffset; i++ {
    		ip := fmt.Sprintf("192.168.1.%d", i+1)
    		if err := r.Allocate(netutils.ParseIPSloppy(ip)); err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 25 20:32:40 UTC 2023
    - 21.1K bytes
    - Viewed (0)
  3. pkg/registry/core/service/allocator/bitmap.go

    			rand:   rand.New(rand.NewSource(time.Now().UnixNano())),
    			offset: offset,
    		},
    		allocated: big.NewInt(0),
    		count:     0,
    		max:       max,
    		rangeSpec: rangeSpec,
    	}
    
    	return &a
    }
    
    // Allocate attempts to reserve the provided item.
    // Returns true if it was allocated, false if it was already in use
    func (r *AllocationBitmap) Allocate(offset int) (bool, error) {
    	r.lock.Lock()
    	defer r.lock.Unlock()
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 25 20:32:40 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  4. pkg/registry/core/service/portallocator/storage/storage_test.go

    		t.Fatalf("unexpected error: %v", err)
    	}
    
    	// Allocate a port inside the valid port range
    	if err := storage.Allocate(30100); err != nil {
    		t.Fatal(err)
    	}
    
    	// Try to allocate the same port in the local bitmap
    	// The local bitmap stores the offset of the port
    	// offset = port - base (30100 - 30000 = 100)
    	ok, err := backing.Allocate(100)
    	if err != nil {
    		t.Fatal(err)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 08 07:15:02 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  5. src/runtime/mpagecache.go

    	}
    	return c.allocN(npages)
    }
    
    // allocN is a helper which attempts to allocate npages worth of pages
    // from the cache. It represents the general case for allocating from
    // the page cache.
    //
    // Returns a base address and the amount of scavenged memory in the
    // allocated region in bytes.
    func (c *pageCache) allocN(npages uintptr) (uintptr, uintptr) {
    	i := findBitRange64(c.cache, uint(npages))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 19 14:30:00 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  6. pkg/kubelet/cm/cpumanager/policy_static.go

    	}
    
    	// Short circuit to regenerate the same hints if there are already
    	// guaranteed CPUs allocated to the Container. This might happen after a
    	// kubelet restart, for example.
    	if allocated, exists := s.GetCPUSet(string(pod.UID), container.Name); exists {
    		if allocated.Size() != requested {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 06 13:16:15 UTC 2023
    - 28.8K bytes
    - Viewed (0)
  7. pkg/scheduler/framework/plugins/dynamicresources/structured/namedresources/namedresourcesmodel.go

    }
    
    func (c *Controller) NodeIsSuitable(ctx context.Context, model Model) (bool, error) {
    	indices, err := c.allocate(ctx, model)
    	return len(indices) == len(c.requests), err
    }
    
    func (c *Controller) Allocate(ctx context.Context, model Model) ([]*resourceapi.NamedResourcesAllocationResult, error) {
    	indices, err := c.allocate(ctx, model)
    	if err != nil {
    		return nil, err
    	}
    	if len(indices) != len(c.requests) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 21:26:16 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  8. pkg/controller/nodeipam/ipam/cidrset/cidr_set.go

    	nodeMaskSize int
    	// maxCIDRs is the maximum number of CIDRs that can be allocated
    	maxCIDRs int
    	// allocatedCIDRs counts the number of CIDRs allocated
    	allocatedCIDRs int
    	// nextCandidate points to the next CIDR that should be free
    	nextCandidate int
    	// used is a bitmap used to track the CIDRs allocated
    	used big.Int
    	// label is used to identify the metrics
    	label string
    }
    
    const (
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 11 08:53:03 UTC 2023
    - 9.4K bytes
    - Viewed (0)
  9. pkg/registry/core/service/portallocator/operation_test.go

    		_ = r.Allocate(port)
    	}
    	freeAtStart := r.Free()
    
    	// Do some allocations with a dry run operation
    	toAllocate := []int{
    		10000,
    		10030,
    		10030,
    		10040,
    	}
    	expectedErrors := []error{
    		ErrAllocated,
    		nil,
    		ErrAllocated,
    		nil,
    	}
    	op := StartOperation(r, true)
    	for i, port := range toAllocate {
    		err := op.Allocate(port)
    		if err != expectedErrors[i] {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Aug 15 23:44:12 UTC 2021
    - 3.1K bytes
    - Viewed (0)
  10. test/fixedbugs/issue16095.go

    	// Initialize x.
    	for i := range x {
    		x[i] = byte(i)
    	}
    
    	// Force x to be allocated on the heap.
    	sink = &x
    	sink = nil
    
    	// Go to deferreturn after the panic below.
    	defer func() {
    		recover()
    	}()
    
    	// This call collects the heap-allocated version of x (oops!)
    	runtime.GC()
    
    	// Allocate that same object again and clobber it.
    	y := new([20]byte)
    	for i := 0; i < 20; i++ {
    		y[i] = 99
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 27 16:48:48 UTC 2016
    - 1.9K bytes
    - Viewed (0)
Back to top