Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for poolInitializer (0.11 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: Wed Jun 12 16:27:09 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: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Apr 15 03:20:20 UTC 2024
    - 32K bytes
    - Viewed (0)
Back to top