Skip to content

Commit 4634d13

Browse files
committed
---
yaml --- r: 1246 b: refs/heads/master c: d55bee4 h: refs/heads/master v: v3
1 parent 719f9d2 commit 4634d13

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 5b9eda4a41a410ffd8529a80c19f499ff856e07f
2+
refs/heads/master: d55bee44179f7dcfebd8eaf1b99730c8473dadea

trunk/src/rt/rust_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static intptr_t const CONST_REFCOUNT = 0x7badface;
9090

9191
// This accounts for logging buffers.
9292

93-
static size_t const BUF_BYTES = 1024;
93+
static size_t const BUF_BYTES = 2048;
9494

9595
// Every reference counted object should derive from this base class.
9696

trunk/src/rt/rust_kernel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ rust_kernel::is_deadlocked() {
119119

120120
void
121121
rust_kernel::log(uint32_t type_bits, char const *fmt, ...) {
122-
char buf[256];
122+
char buf[BUF_BYTES];
123123
if (_log.is_tracing(type_bits)) {
124124
va_list args;
125125
va_start(args, fmt);

trunk/src/rt/rust_log.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ append_string(char *buffer, const char *format, ...) {
114114
if (buffer != NULL && format) {
115115
va_list args;
116116
va_start(args, format);
117-
vsprintf(buffer + strlen(buffer), format, args);
117+
size_t off = strlen(buffer);
118+
vsnprintf(buffer + off, BUF_BYTES - off, format, args);
118119
va_end(args);
119120
}
120121
return buffer;
@@ -127,7 +128,8 @@ append_string(char *buffer, rust_log::ansi_color color,
127128
append_string(buffer, "\x1b%s", _foreground_colors[color]);
128129
va_list args;
129130
va_start(args, format);
130-
vsprintf(buffer + strlen(buffer), format, args);
131+
size_t off = strlen(buffer);
132+
vsnprintf(buffer + off, BUF_BYTES - off, format, args);
131133
va_end(args);
132134
append_string(buffer, "\x1b[0m");
133135
}
@@ -193,7 +195,7 @@ rust_log::trace_ln(rust_task *task, ansi_color color,
193195
uint32_t type_bits, char *message) {
194196
if (is_tracing(type_bits)) {
195197
if (_use_colors) {
196-
char buffer[512] = "";
198+
char buffer[BUF_BYTES] = "";
197199
append_string(buffer, color, "%s", message);
198200
trace_ln(task, buffer);
199201
} else {

trunk/src/rt/rust_task.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ rust_task::get_crate_cache(rust_crate const *curr_crate)
631631

632632
void
633633
rust_task::log(uint32_t type_bits, char const *fmt, ...) {
634-
char buf[256];
634+
char buf[BUF_BYTES];
635635
if (dom->get_log().is_tracing(type_bits)) {
636636
va_list args;
637637
va_start(args, fmt);

0 commit comments

Comments
 (0)