Changeset 1104 in MondoRescue for branches/stable/mondo/src/include/mr_mem.h


Ignore:
Timestamp:
Feb 7, 2007, 8:00:23 PM (13 years ago)
Author:
Bruno Cornec
Message:

Improvement of the low level library (Usage of LINE and FILE and simplified interfaces using macros)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/include/mr_mem.h

    r1096 r1104  
    1717/* functions (public methods) */
    1818
    19 extern inline void mr_free(char *allocated);
    20 extern inline void mr_allocstr(char *alloc, const char *orig);
    21 extern inline void mr_asprintf(char **alloc, const char *fmt, ...);
    22 extern inline void mr_getline(char **lineptr, size_t *n, FILE *stream);
    23 extern inline void *mr_malloc(size_t size);
     19#define mr_free(x) mr_free_int((void **)&x,__LINE__,__FILE__)
     20#define mr_allocstr(x,y) mr_allocstr_int(x, y,__LINE__,__FILE__)
     21#define mr_asprintf(x,y,args...) mr_asprintf_int(x,__LINE__,__FILE__, y, ## args)
     22#define mr_getline(x,y,z) mr_getline_int(x, y,z,__LINE__,__FILE__)
     23#define mr_malloc(x) mr_malloc_int((size_t)x,__LINE__,__FILE__)
     24
     25/* Internal function bringing debuging info
     26 * called indirectly through macros */
     27extern inline void mr_free_int(void **allocated, int line, char *file);
     28extern inline void mr_allocstr_int(char *alloc, const char *orig, int line, char *file);
     29extern inline void mr_asprintf_int(char **alloc, int line, char *file, const char *fmt, ...);
     30extern inline void mr_getline_int(char **lineptr, size_t *n, FILE *stream, int line, char *file);
     31extern inline void *mr_malloc_int(size_t size, int line, char *file);
    2432
    2533#endif                          /* MR_MEM_H */
Note: See TracChangeset for help on using the changeset viewer.