mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Add cgroup v2 support for memory limit (#18905)
This commit is contained in:
@@ -28,7 +28,7 @@ type BytePoolCap struct {
|
||||
|
||||
// NewBytePoolCap creates a new BytePool bounded to the given maxSize, with new
|
||||
// byte arrays sized based on width.
|
||||
func NewBytePoolCap(maxSize int, width int, capwidth int) (bp *BytePoolCap) {
|
||||
func NewBytePoolCap(maxSize uint64, width int, capwidth int) (bp *BytePoolCap) {
|
||||
if capwidth > 0 && capwidth < 64 {
|
||||
panic("buffer capped with smaller than 64 bytes is not supported")
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import "testing"
|
||||
|
||||
// Tests - bytePool functionality.
|
||||
func TestBytePool(t *testing.T) {
|
||||
size := 4
|
||||
size := uint64(4)
|
||||
width := 1024
|
||||
capWidth := 2048
|
||||
|
||||
@@ -49,7 +49,7 @@ func TestBytePool(t *testing.T) {
|
||||
bufPool.Put(b)
|
||||
|
||||
// Fill the pool beyond the capped pool size.
|
||||
for i := 0; i < size*2; i++ {
|
||||
for i := uint64(0); i < size*2; i++ {
|
||||
bufPool.Put(make([]byte, bufPool.w))
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ func TestBytePool(t *testing.T) {
|
||||
close(bufPool.c)
|
||||
|
||||
// Check the size of the pool.
|
||||
if len(bufPool.c) != size {
|
||||
if uint64(len(bufPool.c)) != size {
|
||||
t.Fatalf("bytepool size invalid: got %v want %v", len(bufPool.c), size)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user