aboutsummaryrefslogtreecommitdiff
path: root/tests/dlmalloc.c
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-09-03 22:35:35 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-09-03 22:35:35 -0700
commit7a7ab766e560b812de639c772e1d1d43ad847157 (patch)
treeca1ff06ee9fa38978c715b3bb39160eb1cd60701 /tests/dlmalloc.c
parent6c259a53dd4bf1dd621dc102e0fc37a2c8a38773 (diff)
fix expect bug in library, fixes dlmalloc test
Diffstat (limited to 'tests/dlmalloc.c')
-rw-r--r--tests/dlmalloc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/dlmalloc.c b/tests/dlmalloc.c
index 93bacc63..b4988dce 100644
--- a/tests/dlmalloc.c
+++ b/tests/dlmalloc.c
@@ -5737,3 +5737,28 @@ int main(int ac, char **av)
printf("*%d,%d*\n", c1, c2);
}
+/* Some debugging tools: Make JS and native code work exactly the same */
+/*
+time_t time ( time_t * timer )
+{
+ if (timer) *timer = 1;
+ return 1;
+}
+
+long sysconf(int name)
+{
+ printf("sysconf: %d (30 is page size)\n", name);
+ return 4096;
+}
+
+void *sbrk(intptr_t increment)
+{
+ static char spaace[1024*1024*1];
+ static intptr_t where = 0;
+ printf("sbrk! spaace=%d (%d,%d)\n", (int)&spaace[0], where, increment); // copy the value printed at runtime here in native code into your js
+ void *ret = &spaace[where];
+ where += increment;
+ return ret;
+}
+*/
+