version 1.1.1.2, 2013/07/22 08:44:29
|
version 1.1.1.5, 2021/03/17 00:39:23
|
Line 29
|
Line 29
|
/* Macros */ |
/* Macros */ |
#define MBDATAU(bp) ((u_char *)(bp) + sizeof(struct mpdmbuf) + (bp)->offset) |
#define MBDATAU(bp) ((u_char *)(bp) + sizeof(struct mpdmbuf) + (bp)->offset) |
#define MBDATA(bp) ((bp) ? MBDATAU(bp) : NULL) |
#define MBDATA(bp) ((bp) ? MBDATAU(bp) : NULL) |
#define MBLEN(bp) ((bp) ? (bp)->cnt : 0) | #define MBLEN(bp) ((size_t)((bp) ? (bp)->cnt : 0)) |
#define MBSPACE(bp) ((bp) ? (bp)->size - (bp)->offset : 0) |
#define MBSPACE(bp) ((bp) ? (bp)->size - (bp)->offset : 0) |
|
|
/* Types of allocated memory */ |
/* Types of allocated memory */ |
Line 73
|
Line 73
|
|
|
extern void *Malloc(const char *type, size_t size) __malloc_like; |
extern void *Malloc(const char *type, size_t size) __malloc_like; |
extern void *Mdup(const char *type, const void *src, size_t size) __malloc_like; |
extern void *Mdup(const char *type, const void *src, size_t size) __malloc_like; |
|
extern void *Mdup2(const char *type, const void *src, size_t oldsize, size_t newsize) __malloc_like; |
extern void *Mstrdup(const char *type, const void *src) __malloc_like; |
extern void *Mstrdup(const char *type, const void *src) __malloc_like; |
extern void Freee(void *ptr); |
extern void Freee(void *ptr); |
|
|
Line 89
|
Line 90
|
|
|
/* Etc */ |
/* Etc */ |
|
|
extern int MemStat(Context ctx, int ac, char *av[], void *arg); | extern int MemStat(Context ctx, int ac, const char *const av[], const void *arg); |
extern void DumpBp(Mbuf bp); |
extern void DumpBp(Mbuf bp); |
|
|
#endif |
#endif |