http_response: free response header buffer ASAP
commitd6ee7bafb868a02b76ad22bdffabe6820f6300f9
authorEric Wong <bofh@yhbt.net>
Wed, 28 Aug 2024 18:49:42 +0000 (28 18:49 +0000)
committerEric Wong <BOFH@YHBT.net>
Sun, 17 Nov 2024 21:30:15 +0000 (17 21:30 +0000)
treea39ae8584a98f3ed4074097dc5f306579cf0b533
parente2b2f325fb9cc877496bbd4273fd4bf4fc84ec59
http_response: free response header buffer ASAP

String#clear calls free(3) in C Ruby (as of 3.4 previews) for
non-embedded strings, so release the memory ASAP to reduce
memory pressure during the subsequent body.each iteration.

If the C Ruby GC ever gets escape analysis, this call should
no longer be necessary.  But that may never happen, so provide
a benefit for users today.
lib/unicorn/http_response.rb