Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for poolInitializer (0.07 sec)

  1. schema/pool.go

    package schema
    
    import (
    	"reflect"
    	"sync"
    )
    
    // sync pools
    var (
    	normalPool      sync.Map
    	poolInitializer = func(reflectType reflect.Type) FieldNewValuePool {
    		v, _ := normalPool.LoadOrStore(reflectType, &sync.Pool{
    			New: func() interface{} {
    				return reflect.New(reflectType).Interface()
    			},
    		})
    		return v.(FieldNewValuePool)
    	}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Apr 11 13:37:44 UTC 2022
    - 345 bytes
    - Viewed (0)
  2. schema/field.go

    				return &serializer{
    					Field:      field,
    					Serializer: si.Interface().(SerializerInterface),
    				}
    			},
    		}
    	}
    
    	if field.NewValuePool == nil {
    		field.NewValuePool = poolInitializer(reflect.PtrTo(field.IndirectFieldType))
    	}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Apr 15 03:20:20 UTC 2024
    - 32K bytes
    - Viewed (0)
Back to top