turbo icon indicating copy to clipboard operation
turbo copied to clipboard

remove ffi.gc for http_parser_url

Open gary8520 opened this issue 1 year ago • 2 comments

luajit may manage http_parser_url struct directly instead of managing a struct http_parser_url * and a block of struct http_parser_url instance.

gary8520 avatar Sep 23 '23 16:09 gary8520

this change can fix the following test case by the luajit 2.0.5

self.request.headers.http_parser_url = nil
print("[Debug] url field:", self.request.headers:get_url_field(turbo.httputil.UF.PATH))

collectgarbage("collect")
print("[Debug] url field:", self.request.headers:get_url_field(turbo.httputil.UF.PATH))

before adding this change, the second print cannot get the value since the data seems to be freed by lua GC.

MarcoChen97 avatar Sep 25 '23 02:09 MarcoChen97

@kernelsauce is there any comment about the PR?

gary8520 avatar Jun 07 '24 18:06 gary8520