Skip to content

Commit

Permalink
rpc_util: rename NewSimpleSharedBufferPool to NewsimpleSharedBufferPool
Browse files Browse the repository at this point in the history
  • Loading branch information
hueypark committed Apr 19, 2023
1 parent 9be7889 commit 25b60e3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions benchmark/benchmain/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ func makeClient(bf stats.Features) (testgrpc.BenchmarkServiceClient, func()) {
case recvBufferPoolNil:
// Do nothing.
case recvBufferPoolSimple:
opts = append(opts, grpc.WithRecvBufferPool(grpc.NewSimpleSharedBufferPool()))
sopts = append(sopts, grpc.RecvBufferPool(grpc.NewSimpleSharedBufferPool()))
opts = append(opts, grpc.WithRecvBufferPool(grpc.NewsimpleSharedBufferPool()))
sopts = append(sopts, grpc.RecvBufferPool(grpc.NewsimpleSharedBufferPool()))
default:
logger.Fatalf("Unknown shared recv buffer pool type: %v", bf.RecvBufferPool)
}
Expand Down
2 changes: 1 addition & 1 deletion dialoptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ func WithResolvers(rs ...resolver.Builder) DialOption {
// on the application's workload, this could result in reduced memory allocation.
//
// If you are unsure about how to implement a memory pool but want to utilize one,
// begin with grpc.NewSimpleSharedBufferPool.
// begin with grpc.NewsimpleSharedBufferPool.
//
// Note: The shared buffer pool feature will not be active if any of the following
// options are used: WithStatsHandler, EnableTracing, or binary logging. In such
Expand Down
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ func NumStreamWorkers(numServerWorkers uint32) ServerOption {
// on the application's workload, this could result in reduced memory allocation.
//
// If you are unsure about how to implement a memory pool but want to utilize one,
// begin with grpc.NewSimpleSharedBufferPool.
// begin with grpc.NewsimpleSharedBufferPool.
//
// Note: The shared buffer pool feature will not be active if any of the following
// options are used: StatsHandler, EnableTracing, or binary logging. In such
Expand Down
4 changes: 2 additions & 2 deletions shared_buffer_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ type SharedBufferPool interface {
Put(*[]byte)
}

// NewSimpleSharedBufferPool creates a new SimpleSharedBufferPool with buckets
// NewsimpleSharedBufferPool creates a new simpleSharedBufferPool with buckets
// of different sizes to optimize memory usage. This prevents the pool from
// wasting large amounts of memory, even when handling messages of varying sizes.
//
// # Experimental
//
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
// later release.
func NewSimpleSharedBufferPool() SharedBufferPool {
func NewsimpleSharedBufferPool() SharedBufferPool {
return &simpleSharedBufferPool{
pools: [poolArraySize]simpleSharedBufferChildPool{
newBytesPool(level0PoolMaxSize),
Expand Down
2 changes: 1 addition & 1 deletion shared_buffer_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import "testing"
func (s) TestSharedBufferPool(t *testing.T) {
pools := []SharedBufferPool{
nopBufferPool{},
NewSimpleSharedBufferPool(),
NewsimpleSharedBufferPool(),
}

lengths := []int{
Expand Down

0 comments on commit 25b60e3

Please sign in to comment.