Open trustin opened 7 years ago
I was wondering the same thing. The only instance I can think that this is important is for client applications where developer may want to the user to be overridden and not have their option work. However I support clean up.
@trustin sounds good.
Why would ioBuffer
return a heap buffer? I would assume most/all IO destinations would ultimately require a direct buffer anyways, no?
@Scottmitch for example if you use the OIO transport it is preferred to use a heap buffer as you write / read into byte arrays.
I see. If the primary differentiator is the transport (which the allocator has no knowledge of anyways) we should get rid of these methods (deprecate them).
+1
Am 28.04.2017 um 08:18 schrieb Scott Mitchell notifications@github.com:
I see. If the primary differentiator is the transport (which the allocator has no knowledge of anyways) we should get rid of these methods (deprecate them).
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Currently,
ByteBufAllocator.buffer()
allocates a direct buffer if:sun.misc.Unsafe
is available andio.netty.noPreferDirect
system property is set to true.ByteBufAllocator.ioBuffer()
differes frombuffer()
only in that it does not respect theio.netty.noPreferDirect
.I'm not sure if it makes sense not to respect
io.netty.noPreferDirect
forioBuffer()
. Should we probably just deprecateioBuffer()
in favor ofbuffer()
?