IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30299


Ignore:
Timestamp:
Jan 19, 2011, 3:17:53 PM (15 years ago)
Author:
eugene
Message:

change psKernelAlloc so it psMemCheck reports the file, line where a leak occurs

Location:
branches/eam_branches/ipp-20101205/psLib/src/imageops
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/psLib/src/imageops/psImageConvolve.c

    r28405 r30299  
    6767}
    6868
    69 psKernel *psKernelAlloc(int xMin, int xMax, int yMin, int yMax)
     69psKernel *p_psKernelAlloc(const char *file,
     70                          unsigned int lineno,
     71                          const char *func,
     72                          int xMin, int xMax, int yMin, int yMax)
    7073{
    7174    // Check the inputs to make sure max > min; if not, switch.
     
    9194    int numCols = xMax - xMin + 1;      // Number of columns for kernel image
    9295
    93     psKernel *kernel = psAlloc(sizeof(psKernel)); // The kernel, to be returned
     96    psKernel *kernel = p_psAlloc(file, lineno, func, sizeof(psKernel)); // The kernel, to be returned
    9497    psMemSetDeallocator(kernel,(psFreeFunc)kernelFree);
    9598
  • branches/eam_branches/ipp-20101205/psLib/src/imageops/psImageConvolve.h

    r26892 r30299  
    8484/// @return psKernel*          A new kernel object
    8585///
     86#ifdef DOXYGEN
    8687psKernel *psKernelAlloc(
    8788    int xMin,                          ///< Most negative x index
     
    8990    int yMin,                          ///< Most negative y index
    9091    int yMax                           ///< Most positive y index
     92);
     93#else // ifdef DOXYGEN
     94psKernel *p_psKernelAlloc(
     95    const char *file,                   ///< File of caller
     96    unsigned int lineno,                ///< Line number of caller
     97    const char *func,                   ///< Function name of caller
     98    int xMin,                          ///< Most negative x index
     99    int xMax,                          ///< Most positive x index
     100    int yMin,                          ///< Most negative y index
     101    int yMax                           ///< Most positive y index
    91102) PS_ATTR_MALLOC;
     103#define psKernelAlloc(xMin, xMax, yMin, yMax)                           \
     104    p_psKernelAlloc(__FILE__, __LINE__, __func__, (xMin), (xMax), (yMin), (yMax))
     105#endif // ifdef DOXYGEN
    92106
    93107/// Allocate a convolution kernel from a provided image
Note: See TracChangeset for help on using the changeset viewer.