summaryrefslogtreecommitdiff
path: root/proto/server
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-06-18 05:02:51 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-06-18 05:02:51 -0400
commit3e822e5138238b6cb612942f6397bc513ace358d (patch)
tree8cb081fa628e7b9817f3fbc00769e879e83d09c5 /proto/server
parent6f3249a37812e4386299045c67a54bbf5bd6e358 (diff)
Use a pool of byte arrays to reduce GC pressure.
Diffstat (limited to 'proto/server')
-rwxr-xr-xproto/server/func_handlerequest.go.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/proto/server/func_handlerequest.go.sh b/proto/server/func_handlerequest.go.sh
index 0dffe39..ea07439 100755
--- a/proto/server/func_handlerequest.go.sh
+++ b/proto/server/func_handlerequest.go.sh
@@ -75,6 +75,7 @@ while read -r request; do
echo '_req := req'
echo '_req.Password = sensitive'
echo 'fmt.Fprintf(os.Stderr, "Request: %#v\n", _req)'
+ echo 'p.Free(&_req)'
;;
PAM_PwMod)
echo '_req := req'
@@ -83,11 +84,13 @@ while read -r request; do
echo '}'
echo '_req.NewPassword = sensitive'
echo 'fmt.Fprintf(os.Stderr, "Request: %#v\n", _req)'
+ echo 'p.Free(&_req)'
;;
PAM_UserMod)
echo '_req := req'
echo '_req.Password = sensitive'
echo 'fmt.Fprintf(os.Stderr, "Request: %#v\n", _req)'
+ echo 'p.Free(&_req)'
;;
*)
echo 'fmt.Fprintf(os.Stderr, "Request: %#v\n", req)'
@@ -96,6 +99,7 @@ while read -r request; do
)
_ch := backend.${request}(cred, req)
go func() {
+ defer p.Free(&req)
defer close(ch)
for obj := range _ch {
ch <- obj