ppkarwasz commented on PR #801: URL: https://github.com/apache/commons-io/pull/801#issuecomment-3415368485
> I see: > > ```java > Arrays.fill(SCRATCH_BYTE_BUFFER_WO, (byte) 0); > Arrays.fill(SCRATCH_CHAR_BUFFER_WO, (char) 0); > ``` > > and calls to `fill0()` have been removed. These were only removed, because the buffers themselves have been removed. > > I’m happy to adapt this PR to follow that pattern. > > Let's not make it more complex for now. Adding a reentrancy guard to the thread-local buffers is a simple and well-established pattern: we’ve been using it in Log4j for years. I implemented it in 0bf22e0f880f44572f8666250169f42d270a1c37 by: * Moving the thread locals into a dedicated class, so they are only instantiated on first use (lazy initialization). * Using only JDK-provided classes to avoid potential memory leaks in application server environments. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
