Closed notramo closed 2 months ago
This is what res.arena
is for. It's an std.mem.Allocator
.
I would agree with you that the header value should be copied, if there was a way to tell whether or not the value is a constant. But, without this ability, always copying would result in overhead for the common case where the key or value are constants.
Could you add this explanation to the README?
I want to pass a dynamically formatted
Location
header URL into the response. Sinceresponse.header("Location", url);
does not copy theurl
value (it really should), I have to allocate it, but how to know when to deallocate to avoid memory leak?