Author: Armin Rigo <[email protected]>
Branch:
Changeset: r319:1ba74b051c7b
Date: 2013-06-30 18:28 +0200
http://bitbucket.org/pypy/stmgc/changeset/1ba74b051c7b/
Log: Updates
diff --git a/c4/fprintcolor.c b/c4/fprintcolor.c
--- a/c4/fprintcolor.c
+++ b/c4/fprintcolor.c
@@ -24,12 +24,8 @@
static __thread revision_t tcolor = 0;
static revision_t tnextid = 0;
-
-int threadcolor_printf(const char *format, ...)
+int dprintfcolor(void)
{
- char buffer[2048];
- va_list ap;
- int result;
if (tcolor == 0) {
while (1) {
tcolor = tnextid;
@@ -38,7 +34,15 @@
}
tcolor = 31 + tcolor % 6;
}
- int size = (int)sprintf(buffer, "\033[%dm", (int)tcolor);
+ return tcolor;
+}
+
+int threadcolor_printf(const char *format, ...)
+{
+ char buffer[2048];
+ va_list ap;
+ int result;
+ int size = (int)sprintf(buffer, "\033[%dm", dprintfcolor());
assert(size >= 0);
va_start(ap, format);
diff --git a/c4/fprintcolor.h b/c4/fprintcolor.h
--- a/c4/fprintcolor.h
+++ b/c4/fprintcolor.h
@@ -9,6 +9,7 @@
#ifdef _GC_DEBUG
#define dprintf(args) threadcolor_printf args
+int dprintfcolor(void);
int threadcolor_printf(const char *format, ...)
__attribute__((format (printf, 1, 2)));
@@ -16,5 +17,6 @@
#else
#define dprintf(args) do { } while(0)
+#define dprintfcolor() 0
#endif
diff --git a/c4/nursery.c b/c4/nursery.c
--- a/c4/nursery.c
+++ b/c4/nursery.c
@@ -64,6 +64,7 @@
gcptr P;
char *cur = d->nursery_current;
char *end = cur + size;
+ assert((size & 3) == 0);
d->nursery_current = end;
if (end > d->nursery_nextlimit) {
P = allocate_next_section(size, tid);
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit