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

docs: clarify pointer lifetimes for ktxTexture_SetImageFromMemory #917

Merged
merged 1 commit into from
Jun 18, 2024
Merged

docs: clarify pointer lifetimes for ktxTexture_SetImageFromMemory #917

merged 1 commit into from
Jun 18, 2024

Conversation

matthew-rister
Copy link
Contributor

@matthew-rister matthew-rister commented Jun 5, 2024

Problem
ktxTexture1_SetImageFromMemory and ktxTexture2_SetImageFromMemory accept a pointer to image memory but do not clearly document if ownership of those pointers is transferred or copied.

Solution
This commit adds a Doxygen note informing users that the underlying image data is copied and that they are responsible for freeing the original copy of image memory.

Testing
Documentation updates were manually verified by building the project using the KTX_FEATURE_DOC=ON CMake option and viewing the generated Doxygen output using a local server.

Closes #914

@CLAassistant
Copy link

CLAassistant commented Jun 5, 2024

CLA assistant check
All committers have signed the CLA.

lib/writer2.c Outdated Show resolved Hide resolved
@MarkCallow
Copy link
Collaborator

MarkCallow commented Jun 17, 2024

Sorry for my delay reviewing this. Work was hampered for more than a week by an error in the GitHub Actions Windows runner image.

ktxTexture1_SetImageFromMemory and ktxTexture2_SetImageFromMemory accept
a pointer to image memory but do not clearly document if ownership of
those pointers is transferred or copied. This commit adds a doxygen
warning informing users that the underlying image data is copied and
therefore they are responsible for their copy of the image memory.

Closes #914
@MarkCallow MarkCallow merged commit b2cad1a into KhronosGroup:main Jun 18, 2024
17 checks passed
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.

ktxTexture_SetImageFromMemory should document pointer lifetime guarantees
3 participants