[sldev] Texture Cache: A summary of The Plan as it stands

Dale Mahalko dmahalko at gmail.com
Mon Jun 16 02:55:36 PDT 2008


On Mon, Jun 16, 2008 at 1:07 AM, Buckaroo Mu <sldev at bitparts.org> wrote:
> 2 - The code delimited by USE_LFS_READ and USE_LFS_WRITE - I presume that's
> there to allow better platform neutrality? This may sound 80's of me, but
> would there be any benefit to using #ifdef-delimited blocks to define
> platform-specific read & write functions for the local file system, and
> reduce the overhead of an additional third-party library? Of course, it's
> probably used many other places in the code, but it's just a thought.

It may be that the LFS calls are (becoming) legacy code. As that code
is written the client uses either LFS calls or apr_file calls, and the
globals at the top seem to be forcing the client to only use the
apr_file calls.

Two hours ago I had no clue what the Apache Portable Runtime was for,
but the Wikipedia article says it is designed to provide
cross-platform filesystem access for the Apache server. If a platform
doesn't support a needed feature, then the APR will provide that
functionality directly by itself, making it a very useful library even
when your goal isn't to design a web server.

http://en.wikipedia.org/wiki/Apache_Portable_Runtime

The LFS code was probably the previous method, now superseded by the
apr_file calls. The client code was originally only written for
Windows so the internally-created LLLFS code may at one time have made
sense, but it does not now, as the client spreads to more widely
varying OS platforms.

llapr.cpp:
S32 ll_apr_file_read(apr_file_t* apr_file, void *buf, S32 nbytes)
S32 ll_apr_file_read_ex(const LLString& filename, apr_pool_t* pool,
void *buf, S32 offset, S32 nbytes)
S32 ll_apr_file_write(apr_file_t* apr_file, const void *buf, S32 nbytes)
S32 ll_apr_file_write_ex(const LLString& filename, apr_pool_t* pool,
void *buf, S32 offset, S32 nbytes)
S32 ll_apr_file_seek(apr_file_t* apr_file, apr_seek_where_t where, S32 offset)
bool ll_apr_file_remove(const LLString& filename, apr_pool_t* pool)
bool ll_apr_file_rename(const LLString& filename, const LLString&
newname, apr_pool_t* pool)
bool ll_apr_file_exists(const LLString& filename, apr_pool_t* pool)
S32 ll_apr_file_size(const LLString& filename, apr_pool_t* pool)
bool ll_apr_dir_make(const LLString& dirname, apr_pool_t* pool)
bool ll_apr_dir_remove(const LLString& dirname, apr_pool_t* pool)

I see there are 20 source files that use the Apache Portable Runtime
"apr_file" functions.

Heh, I will see about wikifying this stuff. I'm not really finding
much info about the client's APR usage, in the SL wiki.

- Scalar Tardis / Dale Mahalko


More information about the SLDev mailing list