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

Improve description of string allocation functions #2903

Merged
merged 3 commits into from
Mar 30, 2021

Conversation

henrikt-ma
Copy link
Collaborator

Fixes #2858.

Now that it is clear that these functions are not only for strings that will be returned from the external function, it made sense to break out the part that is specifically about String outputs.

I had to struggle a bit to find a sensible reason why one must not return memory allocated with, say, malloc. It almost seemed silly to not simply make it the responsibility of the external code to somehow take care of cleanup of such strings (typically through the deallocator of an external object, I imagined). Please pay special attention to this new formulation!

chapters/functions.tex Outdated Show resolved Hide resolved
chapters/functions.tex Outdated Show resolved Hide resolved
henrikt-ma and others added 2 commits March 22, 2021 09:19
Applying suggestion by Thomas.

Co-authored-by: Thomas Beutlich <modelica@tbeu.de>
Remove 'all'

Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Copy link
Collaborator

@HansOlsson HansOlsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now.

@HansOlsson HansOlsson merged commit bacbfea into modelica:master Mar 30, 2021
@henrikt-ma henrikt-ma deleted the string-alloc-functions branch March 30, 2021 07:38
@HansOlsson HansOlsson added the M36 For pull requests merged into Modelica 3.6 label Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M36 For pull requests merged into Modelica 3.6
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lack of symmetry between ModelicaAllocateString and ModelicaDuplicateString
3 participants