Deleted Added
sdiff udiff text old ( 286866 ) new ( 296221 )
full compact
1#define assert(e) do { \
2 if (config_debug && !(e)) { \
3 malloc_write("<jemalloc>: Failed assertion\n"); \
4 abort(); \
5 } \
6} while (0)
7
8#define not_reached() do { \

--- 35 unchanged lines hidden (view full) ---

44wrtmessage(void *cbopaque, const char *s)
45{
46
47#ifdef SYS_write
48 /*
49 * Use syscall(2) rather than write(2) when possible in order to avoid
50 * the possibility of memory allocation within libc. This is necessary
51 * on FreeBSD; most operating systems do not have this problem though.
52 */
53 UNUSED int result = syscall(SYS_write, STDERR_FILENO, s, strlen(s));
54#else
55 UNUSED int result = write(STDERR_FILENO, s, strlen(s));
56#endif
57}
58
59JEMALLOC_EXPORT void (*je_malloc_message)(void *, const char *s);
60
61JEMALLOC_ATTR(visibility("hidden"))
62void
63wrtmessage_1_0(const char *s1, const char *s2, const char *s3,

--- 29 unchanged lines hidden (view full) ---

93 * provide a wrapper.
94 */
95int
96buferror(int err, char *buf, size_t buflen)
97{
98
99#ifdef _WIN32
100 FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0,
101 (LPSTR)buf, buflen, NULL);
102 return (0);
103#elif defined(__GLIBC__) && defined(_GNU_SOURCE)
104 char *b = strerror_r(err, buf, buflen);
105 if (b != buf) {
106 strncpy(buf, b, buflen);
107 buf[buflen-1] = '\0';
108 }
109 return (0);

--- 478 unchanged lines hidden (view full) ---

588 break;
589 }}
590 }
591 label_out:
592 if (i < size)
593 str[i] = '\0';
594 else
595 str[size - 1] = '\0';
596 ret = i;
597
598#undef APPEND_C
599#undef APPEND_S
600#undef APPEND_PADDED_S
601#undef GET_ARG_NUMERIC
602 return (ret);
603}
604

--- 54 unchanged lines hidden (view full) ---

659malloc_printf(const char *format, ...)
660{
661 va_list ap;
662
663 va_start(ap, format);
664 malloc_vcprintf(NULL, NULL, format, ap);
665 va_end(ap);
666}