Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_sbuf.c
Show All 37 Lines | |||||
#include <sys/errno.h> | #include <sys/errno.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/limits.h> | #include <sys/limits.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/uio.h> | #include <sys/uio.h> | ||||
#include <machine/stdarg.h> | #include <machine/stdarg.h> | ||||
#else /* _KERNEL */ | #else /* _KERNEL */ | ||||
#include <assert.h> | |||||
#include <ctype.h> | #include <ctype.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
#include <limits.h> | #include <limits.h> | ||||
#include <stdarg.h> | #include <stdarg.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
#include <sys/sbuf.h> | #include <sys/sbuf.h> | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
static MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers"); | static MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers"); | ||||
#define SBMALLOC(size) malloc(size, M_SBUF, M_WAITOK|M_ZERO) | #define SBMALLOC(size) malloc(size, M_SBUF, M_WAITOK|M_ZERO) | ||||
#define SBFREE(buf) free(buf, M_SBUF) | #define SBFREE(buf) free(buf, M_SBUF) | ||||
#else /* _KERNEL */ | #else /* _KERNEL */ | ||||
#define KASSERT(e, m) | #define KASSERT(e, m) assert((e)) | ||||
ngie: This seems like it should be a separate change, maybe. Also, have all of the code paths been… | |||||
#define SBMALLOC(size) calloc(1, size) | #define SBMALLOC(size) calloc(1, size) | ||||
#define SBFREE(buf) free(buf) | #define SBFREE(buf) free(buf) | ||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
/* | /* | ||||
* Predicates | * Predicates | ||||
*/ | */ | ||||
#define SBUF_ISDYNAMIC(s) ((s)->s_flags & SBUF_DYNAMIC) | #define SBUF_ISDYNAMIC(s) ((s)->s_flags & SBUF_DYNAMIC) | ||||
▲ Show 20 Lines • Show All 829 Lines • Show Last 20 Lines |
This seems like it should be a separate change, maybe. Also, have all of the code paths been analyzed to ensure there aren't dead code paths after this change with libsbuf?