package pool

import 

// Option configures pool.
type Option func(Config)

// Config describes generic pool configuration.
type Config interface {
	AddSize(n int)
	SetSizeMapping(func(int) int)
}

// WithSizeLogRange returns an Option that will add logarithmic range of
// pooling sizes containing [min, max] values.
func (,  int) Option {
	return func( Config) {
		pmath.LogarithmicRange(, , func( int) {
			.AddSize()
		})
	}
}

// WithSize returns an Option that will add given pooling size to the pool.
func ( int) Option {
	return func( Config) {
		.AddSize()
	}
}

func ( func(int) int) Option {
	return func( Config) {
		.SetSizeMapping()
	}
}

func () Option {
	return WithSizeMapping(pmath.CeilToPowerOfTwo)
}

func () Option {
	return WithSizeMapping(pmath.Identity)
}