secondlife / secondlife/viewer
Add Memory Map and 64 bit file support to LLAPRFile class
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 299
- Forks
- 146
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 88
Description
Currently the LLAPRFile class only supports 32 bit files and 2 GB file limits.
Propose to add additional 64 bit methods which do not affect existing code, but allow newer code to use 64 bit versions of all APR commands.
The APR library is 64 bit native and the LLAPRFile class down casts to 32 bit.
Propose to expose native 64 bit methods using new 64 bit named versions of the existing LLAPRFile methods.
As well, memory map files are an existing feature of the APR library, but are not currently exposed to the LLAPRFile code base.
Propose to add new methods for loading a memory map file, creating and zeroing out a memory map file as well as assign object pointers to a memory map region.
With a memory map, you could map a data structure directly to memory, with out have to first load the object to RAM, then create a new object, then copy from the read in memory from file to the new object.
This could be helpful for such things as the Texture Fast Cache, or other resources which are cached in a native format that does not require conversion of the data. Could be also used for normal Texture Cache for mapping to a Raw texture to be decoded which would remove the need for File IO to read the data in. If a cache is larger then 2GB for a unified file, 64 file support would allow the file to be used or memory mapped.
Also, the #defines of the LLAPR.h file are using deprecated APR defines. Propose to update to the correct naming from the library which will remove deprecated warnings.
Test Plan
- Regression
- Perform regression testing to validate that Textures, which use LLAPRFIle, load as they have done in the past.
- This will show that the code does not affect the existing calls the LLAPRFile class and its methods.
- 64 Bit file support
- Can create a piece of test code where load a large single file.
- Can create a simple file where you seek to past the 2GB file size location and write a known value to the location.
- Then read back the value by opening the file for reading 64 bit and see if the value returned is the same.
3 Memory Map file support
- Create a piece of test code which opens the file from the second test as a memory map.
- Take a pointer of the data type saved to the file and assign it the location of the saved data.
- Then print out the value stored in the pointer to validate it matches the value from the second test.
This repo is using Opire - what does it mean? 👇
💵 Everyone can add rewards for this issue commenting
/reward 100 (replace 100 with the amount).🕵️♂️ If someone starts working on this issue to earn the rewards, they can comment
/try to let everyone know!🙌 And when they open the PR, they can comment
/claim #4566 either in the PR description or in a PR's comment.🪙 Also, everyone can tip any user commenting
/tip 20 @minerjr (replace 20 with the amount, and @minerjr with the user to tip).📖 If you want to learn more, check out our documentation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the LLAPRFile class and the LLAPR.h definitions mentioned in the issue, then compare their current APR calls and deprecated names with the APR library's native 64-bit and memory-map APIs. Add the proposed 64-bit and memory-map coverage without changing existing calls, and validate regression behavior plus large-file seek/read and memory-map tests described in the test plan.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100