-
Notifications
You must be signed in to change notification settings - Fork 340
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
Refactoring common portions of stumpless_param_to_string and stumpless_element_to_string #183
Comments
I'm adding more context to this issue so that it has enough information to be a viable good first issue for newcomers. The common code between One solution to this is to implement two new private functions that operate on already-locked parameters. One to get the needed size of the buffer for a parameter string, and another to write the string into a provided buffer and return the number of bytes written. // declared in include/private/param.h, defined in src/param.c:
size_t locked_get_param_string_size( struct stumpless_param *param );
size_t locked_param_into_buffer( struct stumpless_param *param, char *buffer, size_t buffer_size);
This will cut down on heap memory allocations and avoid duplicate work, both of which will improve performance. Be sure to check the benchmarks of As with all good first issues, there are a few details missing from this approach, for you to fill in as you encounter them. If you find you need help, please ask here or on the project gitter and someone can help you get past the stumbling block. |
I'll work on this issue when my other pr is merged, if no one has done this already. |
can I be assigned to this?, unless Griezn has already started |
I haven't started this yet so you can do it if you want. |
This is just a follow up issue to improve on #180.
Quoting from #146:
Since #180 did not implement the changes described above I'll go ahead and work on a separate PR for this. I have opened the issue only to document my intent in doing so and to have somewhere to discuss related changes if the need arises.
The text was updated successfully, but these errors were encountered: