Changeset 346
- Timestamp:
- Mar 31, 2004, 6:11:34 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r345 r346 1 %%% $Id: psLibSDRS.tex,v 1.1 8 2004-04-01 03:45:02 price Exp $1 %%% $Id: psLibSDRS.tex,v 1.19 2004-04-01 04:11:34 eugene Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 4 4 % basic document variables 5 \title{Pan-STARRS IPP Library\\ 6 Supplementary Design Requirements} 5 \title{Pan-STARRS IPP Library SDR} % Supplementary Design Requirements 7 6 \author{Paul Price, Eugene Magnier, Robert Lupton} 8 \shorttitle{PSLib Design}7 \shorttitle{PSLib SDR} 9 8 \group{Pan-STARRS Algorithm Group} 10 9 \project{Pan-STARRS Image Processing Pipeline} … … 15 14 % the complete PSDC document number is given by 16 15 % \thedocnumber-\theversion 16 17 \setlength{\topsep}{-2pt} 17 18 18 19 \begin{document} … … 33 34 34 35 \DocumentsInternal 35 PSCD-430-xxx & PS-1 Design Reference Mission \\ 36 \hline 37 PSCD-430-004 & Pan-STARRS IPP C Code Conventions \\ 38 \hline 39 PSCD-430-005 & Pan-STARRS IPP SRS \\ 40 \hline 41 PSCD-430-006 & Pan-STARRS IPP ADD \\ 42 \hline 43 PSCD-430-007 & Pan-STARRS IPP PSLib SDR \\ 44 \hline 45 PSCD-430-008 & Pan-STARRS IPP Architecture SDR \\ 46 36 PSCD-430-xxx & PS-1 Design Reference Mission \\ \hline 37 PSCD-430-004 & Pan-STARRS IPP C Code Conventions \\ \hline 38 PSCD-430-005 & Pan-STARRS IPP SRS \\ \hline 39 PSCD-430-006 & Pan-STARRS IPP ADD \\ \hline 40 PSCD-430-008 & Pan-STARRS IPP Architecture SDR \\ 47 41 \DocumentsExternal 48 42 Posix Standard & Open Group Based Specifications Issue 6, IEEE Std 1003.1, 2003 \\ … … 173 167 memory segments. The segment preceeding the user-memory contains data 174 168 describing the allocated block, using the \code{psMemBlock} structure. 175 The final element of this structure is a \code{void} pointer called 176 \code{magic} and is assigned a special value, \code{PS_MEM_MAGIC}. 177 The segment following the user-memory block consists of a single 178 \code{void} pointer, and is also assigned the special value of 179 \code{PS_MEM_MAGIC}. 169 The first and last elements of this structure \code{void} pointers 170 called \code{startblock} and \code{endblock}, which are assigned a 171 special value, \code{PS_MEM_MAGIC}. The segment following the 172 user-memory block consists of a single \code{void} pointer, and is 173 also assigned the special value of \code{PS_MEM_MAGIC}. This address 174 is pointed to by the structure elements \code{endpost}. 180 175 181 176 In practice, these bounding memory blocks mean that when a user is … … 193 188 \code{sizeof(psMemBlock)} from the pointer address. 194 189 195 The purpose of the t wo boundary markers is to catch corruption and to196 act as an aid in low-level debugging. In the first case, memory over- 197 and under-run errors are likely to overwrite the special values in 198 either the leading or trailing boundaries. The typical situation is 199 one where the coder mis-counts the range and either fills the data190 The purpose of the three boundary markers is to catch corruption and 191 to act as an aid in low-level debugging. In the first case, memory 192 over- and under-run errors are likely to overwrite the special values 193 in either the leading or trailing boundaries. The typical situation 194 is one where the coder mis-counts the range and either fills the data 200 195 just before the start of the valid memory or just after the end of the 201 196 valid memory. These actions will (hopefully) alter the boundary-post … … 212 207 \begin{verbatim} 213 208 typedef struct { 209 const void *startblock; ///< initialised to PS_MEM_MAGIC 214 210 const unsigned long id; ///< a unique ID for this allocation 215 211 const char *file; ///< set from __FILE__ in e.g. p_psAlloc 216 212 const int lineno; ///< set from __LINE__ in e.g. p_psAlloc 217 213 int refCounter; ///< how many times pointer is referenced 218 int state; ///< current state of memory block219 const void * magic;///< initialised to PS_MEM_MAGIC214 const void **endpost; ///< pointer to endpost, initialised to PS_MEM_MAGIC 215 const void *endblock; ///< initialised to PS_MEM_MAGIC 220 216 } psMemBlock; 221 217 \end{verbatim} 222 218 % 223 The firstelement in the structure is a sequential memory block ID.219 The second element in the structure is a sequential memory block ID. 224 220 The memory management system must maintain an internal memory block ID 225 221 counter from which a new ID may be supplied to each newly allocated … … 242 238 strongly encouraged, but not enforced by the memory management system. 243 239 244 The element \code{state} defines the state of the memory block. In 245 order to trace double frees and other memory errors, the memory block 246 reference is not automatically deleted when the assocated memory is 247 deleted. Valid states are \code{PS_MEM_FREE} and \code{PS_MEM_ALLOC}. 240 In order to trace double frees and other memory errors, the memory 241 block reference is not automatically deleted when the assocated memory 242 is deleted. Rather, the \code{psMemBlock} data and the \code{endpost} 243 data are left behind. If endpost points to the memory location 244 immediately following the \code{psMemBlock} data, then the memory 245 block has been freed. This state shall be enforces by \code{psFree}. 248 246 249 247 \subsubsection{APIs for Allocating and Freeing}
Note:
See TracChangeset
for help on using the changeset viewer.
