Search Options

Results per page
Sort
Preferred Languages
Advance

Results 81 - 90 of 397 for nalloc (0.16 sec)

  1. src/runtime/mpagecache_test.go

    		test := test
    		t.Run(name, func(t *testing.T) {
    			c := test.cache
    			for i, h := range test.hits {
    				b, s := c.Alloc(h.npages)
    				if b != h.base {
    					t.Fatalf("bad alloc base #%d: got 0x%x, want 0x%x", i, b, h.base)
    				}
    				if s != h.scav {
    					t.Fatalf("bad alloc scav #%d: got %d, want %d", i, s, h.scav)
    				}
    			}
    		})
    	}
    }
    
    func TestPageCacheFlush(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 06 19:16:48 UTC 2021
    - 10.8K bytes
    - Viewed (0)
  2. src/cmd/cgo/internal/test/issue23555b/a.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package issue23555
    
    // #include <stdlib.h>
    import "C"
    
    func X() {
    	C.free(C.malloc(10))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 12:00:02 UTC 2023
    - 250 bytes
    - Viewed (0)
  3. src/cmd/compile/internal/ssa/_gen/allocators.go

    // e.g. []*Value and []*Block, or even []int32 and []bool.
    
    import (
    	"bytes"
    	"fmt"
    	"go/format"
    	"io"
    	"log"
    	"os"
    )
    
    type allocator struct {
    	name     string // name for alloc/free functions
    	typ      string // the type they return/accept
    	mak      string // code to make a new object (takes power-of-2 size as fmt arg)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 23:34:11 UTC 2023
    - 6.7K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/ssa/compile.go

    			var stats string
    			if logMemStats {
    				var mEnd runtime.MemStats
    				runtime.ReadMemStats(&mEnd)
    				nBytes := mEnd.TotalAlloc - mStart.TotalAlloc
    				nAllocs := mEnd.Mallocs - mStart.Mallocs
    				stats = fmt.Sprintf("[%d ns %d allocs %d bytes]", time, nAllocs, nBytes)
    			} else {
    				stats = fmt.Sprintf("[%d ns]", time)
    			}
    
    			if f.Log() {
    				f.Logf("  pass %s end %s\n", p.name, stats)
    				printFunc(f)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 14:55:18 UTC 2024
    - 18.6K bytes
    - Viewed (0)
  5. src/cmd/cgo/internal/testsanitizers/testdata/asan1_fail.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    /*
    #include <stdlib.h>
    #include <stdio.h>
    
    int *p;
    int* test() {
     p = (int *)malloc(2 * sizeof(int));
     free(p);
     return p;
    }
    */
    import "C"
    import "fmt"
    
    func main() {
    	// C passes Go an invalid pointer.
    	a := C.test()
    	// Use after free
    	*a = 2 // BOOM
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 500 bytes
    - Viewed (0)
  6. pkg/scheduler/framework/plugins/noderesources/resource_allocation.go

    	allocatable := make([]int64, len(r.resources))
    	for i := range r.resources {
    		alloc, req := r.calculateResourceAllocatableRequest(logger, nodeInfo, v1.ResourceName(r.resources[i].Name), podRequests[i])
    		// Only fill the extended resource entry when it's non-zero.
    		if alloc == 0 {
    			continue
    		}
    		allocatable[i] = alloc
    		requested[i] = req
    	}
    
    	score := r.scorer(requested, allocatable)
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 20 14:53:43 UTC 2023
    - 5.3K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/test/issue53888_test.go

    			t.Errorf("got %f allocs, want 0", n)
    		}
    		type S []byte
    
    		s := make(S, n)
    		g := func() {
    			s = append(s[:0], make(S, n)...)
    		}
    		if n := testing.AllocsPerRun(10, g); n > 0 {
    			t.Errorf("got %f allocs, want 0", n)
    		}
    		h := func() {
    			s = append(s[:0], make([]byte, n)...)
    		}
    		if n := testing.AllocsPerRun(10, h); n > 0 {
    			t.Errorf("got %f allocs, want 0", n)
    		}
    		i := func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 09 12:18:20 UTC 2022
    - 1K bytes
    - Viewed (0)
  8. platforms/documentation/docs/src/snippets/native-binaries/objective-cpp/groovy/src/main/objcpp/main.mm

    #import "greeter.h"
    
    int main (int argc, const char * argv[])
    {
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    
        Greeter *greeter = [Greeter new];
        [greeter sayHello];
        [greeter release];
    
        [pool drain];
    
        return 0;
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 249 bytes
    - Viewed (0)
  9. src/testing/benchmark.go

    		return 0
    	}
    	return (float64(r.Bytes) * float64(r.N) / 1e6) / r.T.Seconds()
    }
    
    // AllocsPerOp returns the "allocs/op" metric,
    // which is calculated as r.MemAllocs / r.N.
    func (r BenchmarkResult) AllocsPerOp() int64 {
    	if v, ok := r.Extra["allocs/op"]; ok {
    		return int64(v)
    	}
    	if r.N <= 0 {
    		return 0
    	}
    	return int64(r.MemAllocs) / int64(r.N)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 23.9K bytes
    - Viewed (0)
  10. pkg/registry/core/service/portallocator/controller/repair.go

    	return &Repair{
    		interval:      interval,
    		serviceClient: serviceClient,
    		portRange:     portRange,
    		alloc:         alloc,
    		leaks:         map[int]int{},
    		broadcaster:   eventBroadcaster,
    		recorder:      recorder,
    	}
    }
    
    // RunUntil starts the controller until the provided ch is closed.
    func (c *Repair) RunUntil(onFirstSuccess func(), stopCh chan struct{}) {
    	c.broadcaster.StartRecordingToSink(stopCh)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Sep 30 15:46:06 UTC 2023
    - 10.4K bytes
    - Viewed (0)
Back to top