-
Notifications
You must be signed in to change notification settings - Fork 9
Added allocator to dl_util functions. #92
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
Conversation
The dl_util functions were changed to use the internal allocator. The should not be using the internal allocator since that one is dedicated to be used to the type library. Unfortunately there are conditions as to when the allocations are actually done, so we can't use one temp for the file allocations and one for the instance allocations, since they are sometimes the same. This is to solve issue #90.
wc-duck
left a comment
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.
If the above comments are fixed I'll merge this right away.
include/dl/dl_util.h
Outdated
| filetype - Type of file to read, see dl_util_file_type_t. | ||
| out_instance - Pointer to fill with read instance. | ||
| out_type - TypeID of instance found in file, can be set to 0x0. | ||
| allocator - Allocator for doing temp file allocations |
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.
... and allocating the out-instance!
include/dl/dl_util.h
Outdated
| const char* filename, dl_util_file_type_t filetype, | ||
| void** out_instance, dl_typeid_t* out_type ); | ||
| void** out_instance, dl_typeid_t* out_type, | ||
| dl_allocator *allocator = 0x0 ); |
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 like to keep default-values out of the interface as this breaks c-compat.
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.
This also need doc that says that 0 is valid an what that means.
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.
Ait! I will remove default-value and say that 0 is valid!
The dl_util functions were changed to use the internal allocator. The should not be using the internal allocator since that one is dedicated to be used to the type library. Unfortunately there are conditions as to when the allocations are actually done, so we can't use one temp for the file allocations and one for the instance allocations, since they are sometimes the same. This is to solve issue #90.