We were leaking it and it was "fine", but this way flushed gcda files can't be removed while the process is in execution.
This makes it impossible to collect coverage information for a subset of the execution.
Details
- Reviewers
calixte
Diff Detail
Event Timeline
lib/profile/GCDAProfiling.c | ||
---|---|---|
279 | When CreateFileMapping fails, it returns NULL rather than INVALID_HANDLE_VALUE. For consistency, the sentinel value for mmap_handle should probably be NULL throughout (e.g. in the initializer and unmap_file assignment). |
Made mmap_handle NULL by default (as CreateFileMapping returns NULL on failure and not INVALID_HANDLE_VALUE).
Add calls to FlushViewOfFile and FlushFileBuffers when unmapping to be sure that all the data is written to disk.
lib/profile/GCDAProfiling.c | ||
---|---|---|
34 | this header is probably useless now |
lib/profile/GCDAProfiling.c | ||
---|---|---|
34 | It's needed for flock. |
Moved DWORD_HI and DWORD_LO to WindowsMMap.h, and removed FlushFileBuffers as it fails with ERROR_INVALID_HANDLE.
this header is probably useless now