Skip to content

Commit

Permalink
Use unsafe to inject classes to boot loader (#4026)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit authored Aug 30, 2021
1 parent 9f56888 commit 38470bd
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ private ClassLoader injectHelperClasses(

private Map<String, Class<?>> injectBootstrapClassLoader(Map<String, byte[]> classnameToBytes)
throws IOException {
if (ClassInjector.UsingUnsafe.isAvailable()) {
return ClassInjector.UsingUnsafe.ofBootLoader().injectRaw(classnameToBytes);
}

// Mar 2020: Since we're proactively cleaning up tempDirs, we cannot share dirs per thread.
// If this proves expensive, we could do a per-process tempDir with
// a reference count -- but for now, starting simple.
Expand Down

0 comments on commit 38470bd

Please sign in to comment.