IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1925


Ignore:
Timestamp:
Sep 28, 2004, 4:32:24 PM (22 years ago)
Author:
Paul Price
Message:

"persistent" in psMemBlock, changes to psListRemove.

Location:
trunk/doc/pslib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/pslib/ChangeLogSDRS.tex

    r1916 r1925  
    306306\item Added configuration file grammar.
    307307\item Added explanation of \code{psArray *coords} in
    308   \code{psMinimizeLMFunc}, and changed \code{psMatrix} to \code{psImage}
    309   in response to bug 191.
     308  \code{psMinimizeLMFunc}, and changed \code{psMatrix} to
     309  \code{psImage} in response to bug 191.
    310310\item Added \code{psTimeTable}.
    311311\item \code{psLibInit} altered to load \code{psTime} configuration
     
    313313\item Reworked \code{psList} (including addition of new functions) to
    314314  support multiple iterators.
    315 \item Specified return value for \code{psImageOverlaySection} is the number
    316   of pixels overlaid.
     315\item Specified return value for \code{psImageOverlaySection} is the
     316  number of pixels overlaid.
     317\item Added \code{persistent} to \code{psMemBlock}, along with
     318  additional specification of behaviour of \code{psMemCheckLeaks}.
     319\item Removed \code{psListRemoveNext} and \code{psListRemoveAfter}.
     320  Removing an item pointed to by an iterator doesn't cause an error.
     321
    317322\end{itemize}
  • trunk/doc/pslib/psLibSDRS.tex

    r1917 r1925  
    1 %%% $Id: psLibSDRS.tex,v 1.124 2004-09-28 01:47:46 price Exp $
     1%%% $Id: psLibSDRS.tex,v 1.125 2004-09-29 02:32:24 price Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    307307    pthread_mutex_t   refCounterMutex;  ///< mutex to ensure exclusive access to reference counter
    308308    psReferenceCount refCounter;        ///< how many times pointer is referenced
     309    bool persistent;                    ///< marks if non-user persistent data like error stack, etc.
    309310    const void* endblock;               ///< initialised to p_psMEMMAGIC
    310311} psMemBlock;
     
    342343The element \code{refCounterMutex} is a mutex used to limit access to
    343344the reference counter (below) to a single thread at a time.
     345
     346The element \code{persistent} indicates if the memory is to be used by
     347some non-user persistent data.  This allows memory marked as
     348\code{persistent} to be ignored when identifing memory leaks with
     349\code{psMemCheckLeaks}.  Private functions shall be provided to test
     350and set the value of \code{persistent}.
    344351
    345352The \code{psMemBlock} structure element \code{refCounter} is provided
     
    572579%
    573580\begin{verbatim}
    574 int psMemCheckLeaks(psMemoryId id0, psMemBlock ***array, FILE *fd);
     581int psMemCheckLeaks(psMemoryId id0, psMemBlock ***array, FILE *fd, bool persistence);
    575582int psMemCheckCorruption(bool abort_on_error);
    576583\end{verbatim}
     
    593600of each block that has been allocated but not freed is written to that
    594601file descriptor.
     602
     603If \code{persistence} is \code{false}, then only those
     604\code{psMemBlock}s not marked as \code{persistent} shall be considered
     605as memory leaks.  If \code{persistence} is \code{true}, then all
     606\code{psMemBlocks} shall be considered as memory leaks.
    595607
    596608The routine \code{psMemCheckCorruption} checks the entire heap for
     
    975987returns the error code.
    976988\begin{verbatim}
    977 psErrorCode psError(const char *name, psErrorCode code, bool new, const char *fmt, ...);
    978 \end{verbatim}
    979 
    980 The \code{name} is of the form \code{aaa.bbb.ccc} and identifies the
    981 component raising the error.  The \code{code} is an enumerated type
    982 which lists the possible \textit{classes} of errors
    983 (e.g. \code{PS_ERR_IO}) that \PS{} code can generate (see section
    984 \ref{psErrorCodes}). The \code{new} argument takes a boolean which, if
    985 \code{TRUE} specifies that the error was set initially at this
    986 location, and if \code{FALSE} specifies that an error was passed to
    987 this location.  Raising new error should clear the error stack.  The
    988 final required argument, \code{fmt}, is a \code{printf}-style format
    989 that is passed to \code{psLogMsgV} with code \code{PS_LOG_ERROR}.  The
    990 result of a call to \code{psError} must be to push an error onto a
    991 stack; this stack is cleared if \code{new} is true, or by a call to
     989psErrorCode p_psError(const char *file, int lineno, psErrorCode code, bool new, const char *fmt, ...);
     990#define psError(code, new, fmt, ...) psError(__FILE__, __LINE__, code, new, fmt, __VA_ARGS__)
     991\end{verbatim}
     992
     993\code{psError} is a macro definition that allows the function and line
     994number to be inputted to a private function, \code{p_psError}.  The
     995\code{code} is an enumerated type which lists the possible
     996\textit{classes} of errors (e.g. \code{PS_ERR_IO}) that \PS{} code can
     997generate (see section \ref{psErrorCodes}). The \code{new} argument
     998takes a boolean which, if \code{TRUE} specifies that the error was set
     999initially at this location, and if \code{FALSE} specifies that an
     1000error was passed to this location.  Raising new error should clear the
     1001error stack.  The final required argument, \code{fmt}, is a
     1002\code{printf}-style format that is passed to \code{psLogMsgV} with
     1003code \code{PS_LOG_ERROR}, and component equal to the concatenation of
     1004the file name and the line number, separated by a colon.  The result
     1005of a call to \code{psError} must be to push an error onto a stack;
     1006this stack is cleared if \code{new} is true, or by a call to
    9921007\code{psErrorClear}.
    9931008
     
    15731588bool psListRemove(psList *list, int location)
    15741589bool psListRemoveData(psList *list, void *data);
    1575 bool psListRemoveAfter(psListIterator *iterator);
    1576 bool psListRemoveBefore(psListIterator *iterator);
    15771590\end{verbatim}
    15781591A data item may be removed from the list with these functions.  For
     
    15831596matching the pointer value with \code{void *data}.  The functions
    15841597return a value of \code{true} if the operation was successful, and
    1585 \code{false} otherwise.  The other two functions,
    1586 \code{psListRemoveBefore} and \code{psListRemoveAfter} remove the item
    1587 before or after (respectively) the iteration cursor.  In all cases, if
    1588 any iterators are currently pointing at the item to be removed, or the
    1589 item to be removed is not on the list, an error shall be generated,
    1590 the item shall not be removed, and the function shall return
     1598\code{false} otherwise.  In both cases, if any iterators are currently
     1599pointing at the item to be removed, the item shall be removed and
     1600those iterators pointing at it shall be moved to the next, and the
     1601function shall return \code{true}.  If the item to be removed is not
     1602on the list, an error shall be generated and the function shall return
    15911603\code{false}.
    1592 
    15931604
    15941605\begin{verbatim}
Note: See TracChangeset for help on using the changeset viewer.