[opensource-dev] Review Request: STORM-864: As as developer, I would like an object oriented wrapper to make safe use of memory pools easier

Boroondas Gupte sllists at boroon.dasgupta.ch
Tue Jan 18 04:30:59 PST 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://codereview.secondlife.com/r/99/#review180
-----------------------------------------------------------


I don't feel really qualified to review this, thus just some minor remarks from me:


doc/contributions.txt
<http://codereview.secondlife.com/r/99/#comment115>

    This sorting of contribution entries is not related the issue at hand and should thus happen in a separate commit, if at all. Current policy is to not re-sort existing entries at all, to not mislead Oz' metric gathering tools.
    
    See Oz' comment on https://codereview.secondlife.com/r/78/ and his clarification in this thread:
    https://lists.secondlife.com/pipermail/opensource-dev/2011-January/thread.html#5329
    
    I guess this policy might change again once the tools have been made more robust. Please postpone re-sorting jira entries until then.



indra/llcommon/llaprpool.h
<http://codereview.secondlife.com/r/99/#comment116>

    I think this comment line is noteworthy enough to show it on doxygen, too. Maybe even within an \attention or \warning .



indra/llcommon/llaprpool.h
<http://codereview.secondlife.com/r/99/#comment118>

    Parameters and their behavior can be documented in doxygen with \param .
    
    See http://www.doxygen.nl/commands.html#cmdparam



indra/llcommon/llaprpool.h
<http://codereview.secondlife.com/r/99/#comment119>

    This could be made a doxygen comment.



indra/llcommon/llaprpool.h
<http://codereview.secondlife.com/r/99/#comment117>

    This should probably be a doxygen comment.



indra/llcommon/llaprpool.h
<http://codereview.secondlife.com/r/99/#comment120>

    Why include only the first line in doxygen?



indra/llcommon/llscopedvolatileaprpool.h
<http://codereview.secondlife.com/r/99/#comment121>

    The first "it's" should be "its".



indra/llcommon/llscopedvolatileaprpool.h
<http://codereview.secondlife.com/r/99/#comment122>

    Consider exposing this comment via doxygen.



indra/llcommon/llscopedvolatileaprpool.h
<http://codereview.secondlife.com/r/99/#comment123>

    Another candidate for a \warning or \attention ?



indra/llcommon/llthread.h
<http://codereview.secondlife.com/r/99/#comment124>

    Another candidate for doxygen. \return could be used.



indra/llcommon/llthread.h
<http://codereview.secondlife.com/r/99/#comment125>

    Consider using one line per statement, here.



indra/llcommon/llthread.h
<http://codereview.secondlife.com/r/99/#comment126>

    It looks like the #if MUTEX_DEBUG is almost redundant here. I think it will only have an effect when RELEASE_SHOW_ASSERT is set or SHOW_ASSERT has been manually set. Are you sure you want to suppress this specific assertion in these cases?



indra/llcommon/llthread.cpp
<http://codereview.secondlife.com/r/99/#comment127>

    Worth inlining?


- Boroondas


On Jan. 17, 2011, 7:03 p.m., Aleric Inglewood wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://codereview.secondlife.com/r/99/
> -----------------------------------------------------------
> 
> (Updated Jan. 17, 2011, 7:03 p.m.)
> 
> 
> Review request for Viewer.
> 
> 
> Summary
> -------
> 
> Please see http://jira.secondlife.com/browse/STORM-864
> 
> I made a mercurial repository available for testing here:
> 
> hg clone https://bitbucket.org/aleric/viewer-development-storm-864
> 
> From the commit message:
> 
> Introduces a LLThreadLocalData class that can be
> accessed through the static LLThread::tldata().
> Currently this object contains two (public) thread-local
> objects: a LLAPRRootPool and a LLVolatileAPRPool.
> 
> The first is the general memory pool used by this thread
> (and this thread alone), while the second is intended
> for short lived memory allocations (needed for APR).
> The advantages of not mixing those two is that the latter
> is used most frequently, and as a result of it's nature
> can be destroyed and reconstructed on a "regular" basis.
> 
> This patch adds LLAPRPool (completely replacing the old one),
> which is a wrapper around apr_pool_t* and has complete
> thread-safity checking.
> 
> Whenever an apr call requires memory for some resource,
> a memory pool in the form of an LLAPRPool object can
> be created with the same life-time as this resource;
> assuring clean up of the memory no sooner, but also
> not much later than the life-time of the resource
> that needs the memory.
> 
> Many, many function calls and constructors had the
> pool parameter simply removed (it is no longer the
> concern of the developer, if you don't write code
> that actually does an libapr call then you are no
> longer bothered with memory pools at all).
> 
> However, I kept the notion of short-lived and
> long-lived allocations alive (see my remark in
> the jira here: https://jira.secondlife.com/browse/STORM-864?focusedCommentId=235356&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-235356
> which requires that the LLAPRFile API needs
> to allow the user to specify how long they
> think a file will stay open. By choosing
> 'short_lived' as default for the constructor
> that immediately opens a file, the number of
> instances where this needs to be specified is
> drastically reduced however (obviously, any
> automatic LLAPRFile is short lived).
> 
> 
> This addresses bug STORM-864.
>     http://jira.secondlife.com/browse/STORM-864
> 
> 
> Diffs
> -----
> 
>   doc/contributions.txt 422f636c3343 
>   indra/llaudio/llaudioengine_fmod.cpp 422f636c3343 
>   indra/llaudio/llvorbisencode.cpp 422f636c3343 
>   indra/llcharacter/llbvhloader.cpp 422f636c3343 
>   indra/llcharacter/llkeyframemotionparam.cpp 422f636c3343 
>   indra/llcharacter/llstatemachine.cpp 422f636c3343 
>   indra/llcommon/CMakeLists.txt 422f636c3343 
>   indra/llcommon/llapp.cpp 422f636c3343 
>   indra/llcommon/llapr.h 422f636c3343 
>   indra/llcommon/llapr.cpp 422f636c3343 
>   indra/llcommon/llaprpool.h PRE-CREATION 
>   indra/llcommon/llaprpool.cpp PRE-CREATION 
>   indra/llcommon/llcommon.h 422f636c3343 
>   indra/llcommon/llcommon.cpp 422f636c3343 
>   indra/llcommon/llerror.h 422f636c3343 
>   indra/llcommon/llerror.cpp 422f636c3343 
>   indra/llcommon/llfixedbuffer.cpp 422f636c3343 
>   indra/llcommon/llscopedvolatileaprpool.h PRE-CREATION 
>   indra/llcommon/llthread.h 422f636c3343 
>   indra/llcommon/llthread.cpp 422f636c3343 
>   indra/llcommon/llthreadsafequeue.h 422f636c3343 
>   indra/llcommon/llthreadsafequeue.cpp 422f636c3343 
>   indra/llcommon/llworkerthread.h 422f636c3343 
>   indra/llcommon/llworkerthread.cpp 422f636c3343 
>   indra/llcrashlogger/llcrashlogger.cpp 422f636c3343 
>   indra/llimage/llimage.cpp 422f636c3343 
>   indra/llimage/llimagedimensionsinfo.cpp 422f636c3343 
>   indra/llimage/llimagej2c.cpp 422f636c3343 
>   indra/llimage/llimageworker.h 422f636c3343 
>   indra/llimage/llimageworker.cpp 422f636c3343 
>   indra/llmath/llvolumemgr.cpp 422f636c3343 
>   indra/llmessage/llares.cpp 422f636c3343 
>   indra/llmessage/llcurl.cpp 422f636c3343 
>   indra/llmessage/lliohttpserver.h 422f636c3343 
>   indra/llmessage/lliohttpserver.cpp 422f636c3343 
>   indra/llmessage/lliosocket.h 422f636c3343 
>   indra/llmessage/lliosocket.cpp 422f636c3343 
>   indra/llmessage/llmail.h 422f636c3343 
>   indra/llmessage/llmail.cpp 422f636c3343 
>   indra/llmessage/llpumpio.h 422f636c3343 
>   indra/llmessage/llpumpio.cpp 422f636c3343 
>   indra/llmessage/llurlrequest.cpp 422f636c3343 
>   indra/llmessage/message.cpp 422f636c3343 
>   indra/llmessage/tests/networkio.h 422f636c3343 
>   indra/llplugin/llplugininstance.h 422f636c3343 
>   indra/llplugin/llplugininstance.cpp 422f636c3343 
>   indra/llplugin/llpluginmessagepipe.cpp 422f636c3343 
>   indra/llplugin/llpluginprocesschild.cpp 422f636c3343 
>   indra/llplugin/llpluginprocessparent.h 422f636c3343 
>   indra/llplugin/llpluginprocessparent.cpp 422f636c3343 
>   indra/llplugin/llpluginsharedmemory.h 422f636c3343 
>   indra/llplugin/llpluginsharedmemory.cpp 422f636c3343 
>   indra/llplugin/slplugin/slplugin.cpp 422f636c3343 
>   indra/llvfs/lllfsthread.cpp 422f636c3343 
>   indra/llvfs/llvfs.cpp 422f636c3343 
>   indra/media_plugins/gstreamer010/llmediaimplgstreamer.h 422f636c3343 
>   indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp 422f636c3343 
>   indra/media_plugins/webkit/linux_volume_catcher.cpp 422f636c3343 
>   indra/newview/llappviewer.h 422f636c3343 
>   indra/newview/llappviewer.cpp 422f636c3343 
>   indra/newview/llappviewerlinux.cpp 422f636c3343 
>   indra/newview/llappviewerlinux_api_dbus.cpp 422f636c3343 
>   indra/newview/llappviewermacosx.cpp 422f636c3343 
>   indra/newview/llfloateranimpreview.cpp 422f636c3343 
>   indra/newview/llmainlooprepeater.cpp 422f636c3343 
>   indra/newview/lltexturecache.h 422f636c3343 
>   indra/newview/lltexturecache.cpp 422f636c3343 
>   indra/newview/lltexturefetch.cpp 422f636c3343 
>   indra/newview/llviewermenufile.cpp 422f636c3343 
>   indra/newview/llvoavatar.cpp 422f636c3343 
>   indra/newview/llvocache.h 422f636c3343 
>   indra/newview/llvocache.cpp 422f636c3343 
>   indra/newview/llvoicevivox.cpp 422f636c3343 
>   indra/newview/llwatchdog.cpp 422f636c3343 
>   indra/newview/tests/llworldmap_test.cpp 422f636c3343 
>   indra/test/lltemplatemessagebuilder_tut.cpp 422f636c3343 
>   indra/test/message_tut.cpp 422f636c3343 
>   indra/test/test.cpp 422f636c3343 
>   indra/test_apps/llplugintest/llmediaplugintest.cpp 422f636c3343 
>   indra/viewer_components/updater/llupdateinstaller.cpp 422f636c3343 
> 
> Diff: http://codereview.secondlife.com/r/99/diff
> 
> 
> Testing
> -------
> 
> Compiles and viewer functions normally.
> 
> The new classes (LLAPRPool, LLThreadLocalData) and the LLAPRFile changes have been tested a lot more extensive, since they have been used as-is for months in imprudence and before that in my own viewer (since April). However, the patch contains changes to code elsewhere (to adapt it to the new API) that is rather new in this source tree. Note that changes with regard to LLAPRFile already have been in Snowglobe since version 1.1 (with some minor changes) including the method used to make thread-local data available.
> 
> 
> Thanks,
> 
> Aleric
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/opensource-dev/attachments/20110118/54d9105b/attachment-0001.htm 


More information about the opensource-dev mailing list