2
0
Fork 0

[core] Check if profiler output file has been truncated since opening

This commit is contained in:
Thomas Porzelt 2010-05-15 12:45:22 +02:00
parent e7c68e072b
commit c8a23a947f
1 changed files with 4 additions and 0 deletions

View File

@ -281,11 +281,15 @@ void li_profiler_dump() {
guint i;
gint len;
gchar str[1024];
struct stat st;
gsize leaked_size = 0;
guint leaked_num = 0;
g_static_mutex_lock(&profiler_mutex);
fstat(profiler_output_fd, &st);
lseek(profiler_output_fd, st.st_size, SEEK_SET);
len = sprintf(str, "--------------- memory profiler dump @ %ju ---------------\n", time(NULL));
profiler_write(str, len);