Skip to content

Commit

Permalink
chore(memlimit): Rename cap function to not shadow built-in cap
Browse files Browse the repository at this point in the history
KimMachineGun committed Nov 12, 2023
1 parent bee7662 commit 7097c81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions memlimit/memlimit.go
Original file line number Diff line number Diff line change
@@ -155,12 +155,12 @@ func setGoMemLimit(provider Provider) (int64, error) {
if err != nil {
return 0, err
}
capped := cap(limit)
capped := cappedU64ToI64(limit)
debug.SetMemoryLimit(capped)
return capped, nil
}

func cap(limit uint64) int64 {
func cappedU64ToI64(limit uint64) int64 {
if limit > math.MaxInt64 {
return math.MaxInt64
}

0 comments on commit 7097c81

Please sign in to comment.