Changeset 1925
- Timestamp:
- Sep 28, 2004, 4:32:24 PM (22 years ago)
- Location:
- trunk/doc/pslib
- Files:
-
- 2 edited
-
ChangeLogSDRS.tex (modified) (2 diffs)
-
psLibSDRS.tex (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/ChangeLogSDRS.tex
r1916 r1925 306 306 \item Added configuration file grammar. 307 307 \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. 310 310 \item Added \code{psTimeTable}. 311 311 \item \code{psLibInit} altered to load \code{psTime} configuration … … 313 313 \item Reworked \code{psList} (including addition of new functions) to 314 314 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 317 322 \end{itemize} -
trunk/doc/pslib/psLibSDRS.tex
r1917 r1925 1 %%% $Id: psLibSDRS.tex,v 1.12 4 2004-09-28 01:47:46price Exp $1 %%% $Id: psLibSDRS.tex,v 1.125 2004-09-29 02:32:24 price Exp $ 2 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 … … 307 307 pthread_mutex_t refCounterMutex; ///< mutex to ensure exclusive access to reference counter 308 308 psReferenceCount refCounter; ///< how many times pointer is referenced 309 bool persistent; ///< marks if non-user persistent data like error stack, etc. 309 310 const void* endblock; ///< initialised to p_psMEMMAGIC 310 311 } psMemBlock; … … 342 343 The element \code{refCounterMutex} is a mutex used to limit access to 343 344 the reference counter (below) to a single thread at a time. 345 346 The element \code{persistent} indicates if the memory is to be used by 347 some 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 350 and set the value of \code{persistent}. 344 351 345 352 The \code{psMemBlock} structure element \code{refCounter} is provided … … 572 579 % 573 580 \begin{verbatim} 574 int psMemCheckLeaks(psMemoryId id0, psMemBlock ***array, FILE *fd );581 int psMemCheckLeaks(psMemoryId id0, psMemBlock ***array, FILE *fd, bool persistence); 575 582 int psMemCheckCorruption(bool abort_on_error); 576 583 \end{verbatim} … … 593 600 of each block that has been allocated but not freed is written to that 594 601 file descriptor. 602 603 If \code{persistence} is \code{false}, then only those 604 \code{psMemBlock}s not marked as \code{persistent} shall be considered 605 as memory leaks. If \code{persistence} is \code{true}, then all 606 \code{psMemBlocks} shall be considered as memory leaks. 595 607 596 608 The routine \code{psMemCheckCorruption} checks the entire heap for … … 975 987 returns the error code. 976 988 \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 989 psErrorCode 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 994 number 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 997 generate (see section \ref{psErrorCodes}). The \code{new} argument 998 takes a boolean which, if \code{TRUE} specifies that the error was set 999 initially at this location, and if \code{FALSE} specifies that an 1000 error was passed to this location. Raising new error should clear the 1001 error stack. The final required argument, \code{fmt}, is a 1002 \code{printf}-style format that is passed to \code{psLogMsgV} with 1003 code \code{PS_LOG_ERROR}, and component equal to the concatenation of 1004 the file name and the line number, separated by a colon. The result 1005 of a call to \code{psError} must be to push an error onto a stack; 1006 this stack is cleared if \code{new} is true, or by a call to 992 1007 \code{psErrorClear}. 993 1008 … … 1573 1588 bool psListRemove(psList *list, int location) 1574 1589 bool psListRemoveData(psList *list, void *data); 1575 bool psListRemoveAfter(psListIterator *iterator);1576 bool psListRemoveBefore(psListIterator *iterator);1577 1590 \end{verbatim} 1578 1591 A data item may be removed from the list with these functions. For … … 1583 1596 matching the pointer value with \code{void *data}. The functions 1584 1597 return 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 1599 pointing at the item to be removed, the item shall be removed and 1600 those iterators pointing at it shall be moved to the next, and the 1601 function shall return \code{true}. If the item to be removed is not 1602 on the list, an error shall be generated and the function shall return 1591 1603 \code{false}. 1592 1593 1604 1594 1605 \begin{verbatim}
Note:
See TracChangeset
for help on using the changeset viewer.
