Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ArenaNew (0.15 sec)

  1. src/reflect/arena.go

    //go:build goexperiment.arenas
    
    package reflect
    
    import "arena"
    
    // ArenaNew returns a [Value] representing a pointer to a new zero value for the
    // specified type, allocating storage for it in the provided arena. That is,
    // the returned Value's Type is [PointerTo](typ).
    func ArenaNew(a *arena.Arena, typ Type) Value {
    	return ValueOf(arena_New(a, PointerTo(typ)))
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 15:20:05 UTC 2024
    - 574 bytes
    - Viewed (0)
  2. test/arenas/smoke.go

    			// that sl[j] crashes for some reason. Still, why not check it.
    			log.Fatalf("bad sl[j] value: got %d, want %d", *sl[j], iValue)
    		}
    	}
    
    	t := reflect.TypeOf(int(0))
    	v := reflect.ArenaNew(a, t)
    	if want := reflect.PointerTo(t); v.Type() != want {
    		log.Fatalf("unexpected type for arena-allocated value: got %s, want %s", v.Type(), want)
    	}
    	i2 := v.Interface().(*int)
    	*i2 = iValue
    
    	if *i2 != iValue {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 16 17:08:43 UTC 2023
    - 1.6K bytes
    - Viewed (0)
Back to top