-
Notifications
You must be signed in to change notification settings - Fork 127
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
Solution to Memory leaks by interning external strings #24 per @sletner #234
Conversation
This addresses this issue: #24 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that you're monkey-patching CHUNGA
, which I'm not a fan of. I think it would be preferable to fix the issue there.
headers.lisp
Outdated
|
||
(in-package :chunga) | ||
|
||
(defvar *intern-unsafely*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initialize this with nil
to simplify the check in as-keyword
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just added it
headers.lisp
Outdated
|
||
(defun as-keyword (string &key (destructivep t)) | ||
"Checks if the string STRING is found as a keyword and if it is, returns the keyword, otherwise it returns a string. Note that this is obviously not congruent to the name of the function, it is meant to be an override to the default behavior to avoid memory leaks in Hunchentoot" | ||
(or (gethash string +string-to-keyword-hash+) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not go through +string-to-keyword-hash+
and instead invoke find-symbol
directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just added it
So should I make this changes in chunga instead and open a PR there? |
Yes please! |
Ok, so I made a PR there, will make changes here to account for that as well |
Ok, made the PR over there, please take a look at the code since I am implementing it differently than here since it's all internal to chunga and there's no need for the |
The |
Thank you as well for the guidance and being so responsive! |
No description provided.