Fix log message about using non-direct buffers by default (#8235)
Motivation:f77891cc17
changed slightly how we detect if we should prefer direct buffers or not but did miss to also take this into account when logging. Modifications: Fix branch for log message to reflect changes inf77891cc17
. Result: Correct logging.
This commit is contained in:
parent
b73f785631
commit
4a5b61fc13
@ -128,17 +128,6 @@ public final class PlatformDependent {
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* We do not want to log this message if unsafe is explicitly disabled. Do not remove the explicit no unsafe
|
||||
* guard.
|
||||
*/
|
||||
if (!hasUnsafe() && !isAndroid() && !PlatformDependent0.isExplicitNoUnsafe()) {
|
||||
logger.info(
|
||||
"Your platform does not provide complete low-level API for accessing direct buffers reliably. " +
|
||||
"Unless explicitly requested, heap buffer will always be preferred to avoid potential system " +
|
||||
"instability.");
|
||||
}
|
||||
|
||||
// Here is how the system property is used:
|
||||
//
|
||||
// * < 0 - Don't use cleaner, and inherit max direct memory from java. In this case the
|
||||
@ -193,6 +182,17 @@ public final class PlatformDependent {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("-Dio.netty.noPreferDirect: {}", !DIRECT_BUFFER_PREFERRED);
|
||||
}
|
||||
|
||||
/*
|
||||
* We do not want to log this message if unsafe is explicitly disabled. Do not remove the explicit no unsafe
|
||||
* guard.
|
||||
*/
|
||||
if (CLEANER == NOOP && !PlatformDependent0.isExplicitNoUnsafe()) {
|
||||
logger.info(
|
||||
"Your platform does not provide complete low-level API for accessing direct buffers reliably. " +
|
||||
"Unless explicitly requested, heap buffer will always be preferred to avoid potential system " +
|
||||
"instability.");
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasDirectBufferNoCleanerConstructor() {
|
||||
|
Loading…
Reference in New Issue
Block a user