git-2.22.0/refs/packed-backend.c
/*
 * If the buffer in `snapshot` is active, then either munmap the
 * memory and close the file, or free the memory. Then set the buffer
 * pointers to NULL.
 */
If the buffer in `snapshot` is active, then either munmap the
memory and close the file, or free the memory. Then set the buffer
pointers to NULL.
If the buffer in ` snapshot ` is active then either munmap the memory and close the file or free the memory . Then set the buffer pointers to NULL .
static void clear_snapshot_buffer(struct snapshot *snapshot)
{
	if (snapshot->mmapped) {
		if (munmap(snapshot->buf, snapshot->eof - snapshot->buf))
			die_errno("error ummapping packed-refs file %s",
				  snapshot->refs->path);
		snapshot->mmapped = 0;
	} else {
		free(snapshot->buf);
	}
	snapshot->buf = snapshot->start = snapshot->eof = NULL;
}
static void clear_snapshot_buffer ( struct snapshot * snapshot ) { if ( snapshot -> mmapped ) { if ( munmap ( snapshot -> buf , snapshot -> eof - snapshot -> buf ) ) die_errno ( " " , snapshot -> refs -> path ) ; snapshot -> mmapped = 0 ; } else { free ( snapshot -> buf ) ; } snapshot -> buf = snapshot -> start = snapshot -> eof = NULL ; }
If the buffer in `snapshot` is active, then either munmap the
 memory and close the file, or free the memory.
If the buffer in ` snapshot ` is active then either munmap the memory and close the file or free the memory .