Skip to content

Commit

Permalink
minor repo cleanup (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
mangalaman93 authored Sep 4, 2023
1 parent 9144662 commit 1854617
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CODEOWNERS info: https://help.github.com/en/articles/about-code-owners
# Owners are automatically requested for review for PRs that changes code
# that they own.
* @joshua-goldstein @mangalaman93 @harshil-goel
* @joshua-goldstein @mangalaman93 @harshil-goel @all-seeing-code
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/documentation_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ body:
- type: textarea
attributes:
label: What version of Ristretto is the target?
description: Is it the latest version?
description: Is it the latest version?
placeholder: |
Type here.
validations:
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ body:
value: |
Thank you for reporting an issue.
If you think we can make Ristretto better, describe your feature request here.
Note: Feature requests are judged based on user experience and modeled on
[Go Experience Reports](https://github.com/golang/go/wiki/ExperienceReports).
Note: Feature requests are judged based on user experience and modeled on
[Go Experience Reports](https://github.com/golang/go/wiki/ExperienceReports).
These reports should focus on the problems - they should not focus on and need not propose solutions.
- type: dropdown
attributes:
Expand Down
4 changes: 2 additions & 2 deletions contrib/memtest/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
memtest tests the effect of the C memory allocator. The default version uses Calloc from the stdlib.
memtest tests the effect of the C memory allocator. The default version uses Calloc from the stdlib.

If the program is built using the `jemalloc` build tag, then the allocator used will be jemalloc.

Expand All @@ -13,4 +13,4 @@ sleep 1
done
```

This is of course contingent upon the fact that the binary of this program is called `memtest`.
This is of course contingent upon the fact that the binary of this program is called `memtest`.
2 changes: 1 addition & 1 deletion contrib/memtest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func viaLL() {
func main() {
check()
fill = make([]byte, maxMB<<20)
rand.Read(fill)
_, _ = rand.Read(fill)

c := make(chan os.Signal, 10)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
Expand Down
3 changes: 1 addition & 2 deletions policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const (
)

// policy is the interface encapsulating eviction/admission behavior.
//
// TODO: remove this interface and just rename defaultPolicy to policy, as we
// are probably only going to use/implement/maintain one policy.
type policy interface {
Expand Down Expand Up @@ -346,7 +345,7 @@ func (p *sampledLFU) updateIfHas(key uint64, cost int64) bool {
p.metrics.add(keyUpdate, key, 1)
if prev > cost {
diff := prev - cost
p.metrics.add(costAdd, key, ^uint64(diff-1))
p.metrics.add(costAdd, key, ^(uint64(diff) - 1))
} else if cost > prev {
diff := cost - prev
p.metrics.add(costAdd, key, uint64(diff))
Expand Down
5 changes: 2 additions & 3 deletions z/allocator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func TestAllocateConcurrent(t *testing.T) {
mu := new(sync.Mutex)
for i := 0; i < M; i++ {
wg.Add(1)
go func() { //nolint:staticcheck,govet
go func() {
defer wg.Done()
var bufs []uintptr
for j := 0; j < N; j++ {
Expand All @@ -149,8 +149,7 @@ func TestAllocateConcurrent(t *testing.T) {
mu.Lock()
for _, b := range bufs {
if _, ok := m[b]; ok {
//nolint:staticcheck,govet
t.Fatalf("Did not expect to see the same ptr")
panic("did not expect to see the same ptr")
}
m[b] = struct{}{}
}
Expand Down
2 changes: 1 addition & 1 deletion z/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (sf *SuperFlag) mergeAndCheckDefaultImpl(flag string) (*SuperFlag, error) {
}
}
if numKeys != 0 {
return nil, fmt.Errorf("superflag: found invalid options in flag: %s.\nvalid options: %v", sf, flag)
return nil, fmt.Errorf("superflag: found invalid options: %s.\nvalid options: %v", sf, flag)
}
for k, v := range src {
if _, ok := sf.m[k]; !ok {
Expand Down

0 comments on commit 1854617

Please sign in to comment.