IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 15, 2008, 11:24:30 AM (18 years ago)
Author:
jhoblitt
Message:

add efence hooks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/nebclient/src/xmalloc.h

    r4677 r19553  
    44 * Copyright (C) 2003-2005  Joshua Hoblitt, 2003  Robert Lupton
    55 *
    6  * $Id: xmalloc.h,v 1.4 2005-07-30 02:45:31 jhoblitt Exp $
     6 * $Id: xmalloc.h,v 1.5 2008-09-15 21:24:30 jhoblitt Exp $
    77 */
    88
     
    1010#define XMALLOC_H 1
    1111
    12 void * xmalloc(size_t n);
     12#define xmalloc(size) \
     13x_xmalloc(__FILE__, __LINE__, __func__, size)
    1314
    14 void * xrealloc(void *ptr, size_t size);
     15void * x_xmalloc(
     16    const char *file,                  ///< File of caller
     17    unsigned int lineno,               ///< Line number of caller
     18    const char *func,                  ///< Function name of caller
     19    size_t n
     20#ifdef __GNUC__
     21) __attribute__((malloc));
     22# else // ifdef __GNUC__
     23);
     24#endif // ifdef __GNUC__
     25
     26
     27#define xrealloc(ptr, size) \
     28x_xrealloc(__FILE__, __LINE__, __func__, ptr, size)
     29
     30void * x_xrealloc(
     31    const char *file,                  ///< File of caller
     32    unsigned int lineno,               ///< Line number of caller
     33    const char *func,                  ///< Function name of caller
     34    void *ptr,
     35    size_t size
     36#ifdef __GNUC__
     37) __attribute__((malloc));
     38# else // ifdef __GNUC__
     39);
     40#endif // ifdef __GNUC__
    1541 
    16 void xfree(void *ptr);
     42#define xfree(ptr) \
     43x_xfree(__FILE__, __LINE__, __func__, ptr)
     44
     45void x_xfree(
     46    const char *file,                  ///< File of caller
     47    unsigned int lineno,               ///< Line number of caller
     48    const char *func,                  ///< Function name of caller
     49    void *ptr
     50);
    1751
    1852#endif // XMALLOC_H
Note: See TracChangeset for help on using the changeset viewer.