Skip to content

Commit

Permalink
Merge pull request #67 from fufuok/master
Browse files Browse the repository at this point in the history
add arpc.HandleFree()
  • Loading branch information
lesismal authored Aug 6, 2024
2 parents b9bb0b6 + d9ed04b commit cdbd72f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,11 @@ func HandleMalloc(f func(int) []byte) {
DefaultHandler.HandleMalloc(f)
}

// HandleFree registers buffer releaser.
func HandleFree(f func([]byte)) {
DefaultHandler.HandleFree(f)
}

// EnablePool registers handlers for pool operation for Context and Message and Message.Buffer
func EnablePool(enable bool) {
DefaultHandler.EnablePool(enable)
Expand Down
1 change: 1 addition & 0 deletions handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,6 @@ func TestSetHandler(t *testing.T) {
Handle("nothing", func(*Context) {}, true)
HandleNotFound(func(*Context) {})
HandleMalloc(func(int) []byte { return nil })
HandleFree(func([]byte) {})
SetHandler(d)
}

0 comments on commit cdbd72f

Please sign in to comment.