Skip to content

Commit

Permalink
Don't attempt to update cache entries on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Jan 30, 2024
1 parent 34f1be9 commit 6ff60c6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion ext/bootsnap/bootsnap.c
Expand Up @@ -38,6 +38,10 @@
#define RB_UNLIKELY(x) (x)
#endif

#ifdef HAVE_FDATASYNC
#define BS_REVALIDATE_CACHE 1
#endif

/*
* An instance of this key is written as the first 64 bytes of each cache file.
* The mtime and size members track whether the file contents have changed, and
Expand Down Expand Up @@ -319,7 +323,15 @@ static enum cache_status cache_key_equal_fast_path(struct bs_cache_key *k1,
k1->ruby_platform == k2->ruby_platform &&
k1->compile_option == k2->compile_option &&
k1->ruby_revision == k2->ruby_revision && k1->size == k2->size) {
return (k1->mtime == k2->mtime) ? hit : stale;
if (k1->mtime == k2->mtime) {
return hit;
} else {
#ifdef BS_REVALIDATE_CACHE
return stale;
#else
return miss;
#endif
}
}
return miss;
}
Expand Down

0 comments on commit 6ff60c6

Please sign in to comment.