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

refactor(util): Separate the construction of BuildInfo and ApplicationDescription #6433

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

RolfKal
Copy link
Contributor

@RolfKal RolfKal commented Apr 22, 2024

Separate this functionality into their own exported functions to allow querying the build version from a client. Use these functions in the server to construct the default server configuration structure.

@jpfr
Copy link
Member

jpfr commented Jun 10, 2024

Instead of methods I would constant global variables.
Because all the methods do is return a "static" value.

extern const UA_BuildInfo UA_BuildInfo_default;

We have UA_STRING_STATIC, etc. to help put together compile-time instance definitions of the built-in datatypes.

@jpfr
Copy link
Member

jpfr commented Jun 26, 2024

There was an update a few days ago.
Please consider the review comment.

@RolfKal
Copy link
Contributor Author

RolfKal commented Jun 28, 2024

I was going to look into it but needed to verify a few more things. One issue with using exported static variables instead of functions is that there is an additional complexity when trying to dynamically import exported data symbols. Also I wasn't sure if static allocated strings in data variables are properly ignored when a structure containing them gets passed to the standard memory_clear functions.

@jpfr
Copy link
Member

jpfr commented Jul 1, 2024

If you make the exported variables const, then everybody will know to make a copy.
Otherwise the static memory gets freed when the configuration is cleaned up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants