lemoncake

rbtree based memory allocator
git clone git://git.2f30.org/lemoncake.git
Log | Files | Refs | README | LICENSE

commit dc4dfa2c8743816c2c7bff77da46172a3ed64226
parent aeb9cb9c7b7f9cf626c4f6d2dded3f6866f35b15
Author: sin <sin@2f30.org>
Date:   Fri Aug  2 15:59:01 +0100

Use O_APPEND for logfile + marker

Diffstat:
lemoncake.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lemoncake.c b/lemoncake.c @@ -67,8 +67,11 @@ dump_trees(void) char buf[BUFSIZ]; int fd; - fd = open("lemoncake.out", O_WRONLY | O_CREAT, 0644); + fd = open("lemoncake.out", O_WRONLY | O_CREAT | O_APPEND, 0644); if (fd != -1) { + snprintf(buf, sizeof(buf), + "*** Dumping alloc + free trees ***\n"); + write(fd, buf, strlen(buf)); RB_FOREACH(n, alloc_tree, &at) { snprintf(buf, sizeof(buf), "alloc: buf: %p, size: %zu\n",