IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 346


Ignore:
Timestamp:
Mar 31, 2004, 6:11:34 PM (22 years ago)
Author:
eugene
Message:

minor edits

File:
1 edited

Legend:

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

    r345 r346  
    1 %%% $Id: psLibSDRS.tex,v 1.18 2004-04-01 03:45:02 price Exp $
     1%%% $Id: psLibSDRS.tex,v 1.19 2004-04-01 04:11:34 eugene Exp $
    22\documentclass[panstarrs]{panstarrs}
    33
    44% basic document variables
    5 \title{Pan-STARRS IPP Library\\
    6 Supplementary Design Requirements}
     5\title{Pan-STARRS IPP Library SDR} % Supplementary Design Requirements
    76\author{Paul Price, Eugene Magnier, Robert Lupton}
    8 \shorttitle{PSLib Design}
     7\shorttitle{PSLib SDR}
    98\group{Pan-STARRS Algorithm Group}
    109\project{Pan-STARRS Image Processing Pipeline}
     
    1514% the complete PSDC document number is given by
    1615% \thedocnumber-\theversion
     16
     17\setlength{\topsep}{-2pt}
    1718
    1819\begin{document}
     
    3334
    3435\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 
     36PSCD-430-xxx  &   PS-1 Design Reference Mission \\ \hline
     37PSCD-430-004  &   Pan-STARRS IPP C Code Conventions \\ \hline
     38PSCD-430-005  &   Pan-STARRS IPP SRS \\ \hline
     39PSCD-430-006  &   Pan-STARRS IPP ADD \\ \hline
     40PSCD-430-008  &   Pan-STARRS IPP Architecture SDR \\
    4741\DocumentsExternal
    4842Posix Standard & Open Group Based Specifications Issue 6, IEEE Std 1003.1, 2003 \\
     
    173167memory segments.  The segment preceeding the user-memory contains data
    174168describing 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}.
     169The first and last elements of this structure \code{void} pointers
     170called \code{startblock} and \code{endblock}, which are assigned a
     171special value, \code{PS_MEM_MAGIC}.  The segment following the
     172user-memory block consists of a single \code{void} pointer, and is
     173also assigned the special value of \code{PS_MEM_MAGIC}.  This address
     174is pointed to by the structure elements \code{endpost}.
    180175
    181176In practice, these bounding memory blocks mean that when a user is
     
    193188\code{sizeof(psMemBlock)} from the pointer address.
    194189
    195 The purpose of the two boundary markers is to catch corruption and to
    196 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 data
     190The purpose of the three boundary markers is to catch corruption and
     191to act as an aid in low-level debugging.  In the first case, memory
     192over- and under-run errors are likely to overwrite the special values
     193in either the leading or trailing boundaries.  The typical situation
     194is one where the coder mis-counts the range and either fills the data
    200195just before the start of the valid memory or just after the end of the
    201196valid memory.  These actions will (hopefully) alter the boundary-post
     
    212207\begin{verbatim}
    213208typedef struct {
     209    const void *startblock;             ///< initialised to PS_MEM_MAGIC
    214210    const unsigned long id;             ///< a unique ID for this allocation
    215211    const char *file;                   ///< set from __FILE__ in e.g. p_psAlloc
    216212    const int lineno;                   ///< set from __LINE__ in e.g. p_psAlloc
    217213    int refCounter;                     ///< how many times pointer is referenced
    218     int state;                          ///< current state of memory block
    219     const void *magic;                  ///< initialised to PS_MEM_MAGIC
     214    const void **endpost;               ///< pointer to endpost, initialised to PS_MEM_MAGIC
     215    const void *endblock;              ///< initialised to PS_MEM_MAGIC
    220216} psMemBlock;
    221217\end{verbatim}
    222218%
    223 The first element in the structure is a sequential memory block ID.
     219The second element in the structure is a sequential memory block ID.
    224220The memory management system must maintain an internal memory block ID
    225221counter from which a new ID may be supplied to each newly allocated
     
    242238strongly encouraged, but not enforced by the memory management system.
    243239
    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}.
     240In order to trace double frees and other memory errors, the memory
     241block reference is not automatically deleted when the assocated memory
     242is deleted.  Rather, the \code{psMemBlock} data and the \code{endpost}
     243data are left behind.  If endpost points to the memory location
     244immediately following the \code{psMemBlock} data, then the memory
     245block has been freed.  This state shall be enforces by \code{psFree}.
    248246
    249247\subsubsection{APIs for Allocating and Freeing}
Note: See TracChangeset for help on using the changeset viewer.