Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for Arena (0.15 sec)

  1. src/arena/arena_test.go

    // license that can be found in the LICENSE file.
    
    //go:build goexperiment.arenas
    
    package arena_test
    
    import (
    	"arena"
    	"testing"
    )
    
    type T1 struct {
    	n int
    }
    type T2 [1 << 20]byte // 1MiB
    
    func TestSmoke(t *testing.T) {
    	a := arena.NewArena()
    	defer a.Free()
    
    	tt := arena.New[T1](a)
    	tt.n = 1
    
    	ts := arena.MakeSlice[T1](a, 99, 100)
    	if len(ts) != 99 {
    		t.Errorf("Slice() len = %d, want 99", len(ts))
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Oct 12 20:23:36 GMT 2022
    - 742 bytes
    - Viewed (0)
Back to top