Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove ffi.gc for http_parser_url #366

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gary8520
Copy link

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.

@MarcoChen97
Copy link

MarcoChen97 commented Sep 25, 2023

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.

@gary8520
Copy link
Author

gary8520 commented Jun 7, 2024

@kernelsauce is there any comment about the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants