Skip to content

Add file size to cgltf_file_options::release callback#278

Merged
jkuhlmann merged 2 commits intojkuhlmann:masterfrom
zeux:file-release-size
Sep 13, 2025
Merged

Add file size to cgltf_file_options::release callback#278
jkuhlmann merged 2 commits intojkuhlmann:masterfrom
zeux:file-release-size

Conversation

@zeux
Copy link
Contributor

@zeux zeux commented Sep 13, 2025

This is necessary for POSIX systems to be able to implement file loading via mmap/munmap since munmap takes the size (unlike Windows). Without this, the implementation would need to keep a map from file pointer to file size to be able to unmap the file.

This change requires minor adjustment for people who use file callbacks but the change should be very straightforward and will be flagged during the upgrade by the compiler.

This is necessary for POSIX systems to be able to implement file loading
via mmap/munmap since munmap takes the size (unlike Windows). Without
this, the implementation would need to keep a map from file pointer to
file size to be able to unmap the file.

This change requires minor adjustment for people who use file callbacks
but the change should be very straightforward and will be flagged during
the upgrade by the compiler.
We now support a full range of 3.5...3.30 to avoid breakage for the next
few years.
@jkuhlmann jkuhlmann merged commit a46a111 into jkuhlmann:master Sep 13, 2025
3 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.

2 participants