-
Notifications
You must be signed in to change notification settings - Fork 464
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
Fix memory leak and other improvements #925
Conversation
e45ca94
to
c90ab53
Compare
Fixed some left over issues with interpolate parsing: |
👍 The higher the version is, more sensitive these libraries become (from GC perspective).. (-8 |
Plus a few other minor improvements
Addresses sass#869 This is a breaking change since implementers need to make a copy of the string if they are not able to pass the complete memory ownership to libsass.
9d07a48
to
5ce9d23
Compare
Fix memory leak and other improvements
(disclaimer I haven't debugged libsass latest code yet) @mgreter, is it also applicable to After upgrading to Next, I also removed the free statement for |
I hope the following explains your question struct Sass_File_Context* sass_make_file_context (const char* input_path);
struct Sass_Data_Context* sass_make_data_context (char* source_string); So we do make a copy of the path, since we expect it to always be a pretty cheap operation. |
@mgreter, thanks for the comment. There are some source_map path related issues I am facing with 3.2.0-beta.1. Some tests are failing because |
* Updates sass-spec to corresponding commit. * Prevents source_string from freeing in data context case in binding code. * Corresponds to sass/libsass#925.
* Updates sass-spec to corresponding commit. * Prevents source_string from freeing in data context case in binding code. * Corresponds to sass/libsass#925.
* Updates sass-spec to corresponding commit. * Prevents source_string from freeing in data context case in binding code. * Corresponds to sass/libsass#925.
* Updates sass-spec to corresponding commit. * Prevents source_string from freeing in data context case in binding code. * Corresponds to sass/libsass#925.
* Updates sass-spec to corresponding commit. * Prevents source_string from freeing in data context case in binding code. * Corresponds to sass/libsass#925.
* Updates sass-spec to corresponding commit. * Prevents source_string from freeing in data context case in binding code. * Corresponds to sass/libsass#925.
* Updates sass-spec to corresponding commit. * Prevents source_string from freeing in data context case in binding code. * Corresponds to sass/libsass#925.
* Updates sass-spec to corresponding commit. * Prevents source_string from freeing in data context case in binding code. * Corresponds to sass/libsass#925.
This contains one breaking change for implementors (//CC @am11):
We made an error with
sass_make_data_context(char* data)
. We made a copy of that string pointer, which we should not have be doing, since the API indicates that libsass will take ownership of that memory. You may either have leaked memory unintentionally (which would then be fixed by this commit) or you will need to create a copy before passing it to libsass (or tell your GC that it is no longer in control of that memory).Otherwise it fixes a few memory leaks in cssize.cpp and removes the
copy_c_str
sources in favor of another small function inutil
. Addresses #869