[ 
https://issues.apache.org/jira/browse/DRILL-4134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15032824#comment-15032824
 ] 

ASF GitHub Bot commented on DRILL-4134:
---------------------------------------

Github user julienledem commented on a diff in the pull request:

    https://github.com/apache/drill/pull/283#discussion_r46227624
  
    --- Diff: exec/memory/base/src/main/java/io/netty/buffer/DrillBuf.java ---
    @@ -186,42 +137,110 @@ private final void checkIndexD(int index, int 
fieldLength) {
        * @param start The starting position of the bytes to be read.
        * @param end The exclusive endpoint of the bytes to be read.
        */
    -  public void checkBytes(int start, int end){
    -    if (BOUNDS_CHECKING_ENABLED) {
    +  public void checkBytes(int start, int end) {
    +    if (BoundsChecking.BOUNDS_CHECKING_ENABLED) {
           checkIndexD(start, end - start);
         }
       }
     
       private void chk(int index, int width) {
    -    if (BOUNDS_CHECKING_ENABLED) {
    +    if (BoundsChecking.BOUNDS_CHECKING_ENABLED) {
           checkIndexD(index, width);
         }
       }
     
    -  private void chk(int index) {
    -    if (BOUNDS_CHECKING_ENABLED) {
    -      checkIndexD(index);
    +  private void ensure(int width) {
    +    if (BoundsChecking.BOUNDS_CHECKING_ENABLED) {
    +      ensureWritable(width);
         }
       }
     
    -  private void ensure(int width) {
    -    if (BOUNDS_CHECKING_ENABLED) {
    -      ensureWritable(width);
    +  /**
    +   * Create a new DrillBuf that is associated with an alternative 
allocator for the purposes of memory ownership and
    +   * accounting. This has no impact on the reference counting for this 
allocator.
    +   *
    +   * This operation has no impact on the reference count of this DrillBuf. 
The newly created DrillBuf with either have a
    +   * reference count of 1 (in the case that this is the first time this 
memory is being associated with the new
    +   * allocator) or the current value of the reference count + 1 for the 
other AllocatorManager/BufferLedger combination
    +   * in the case that the provided allocator already had an association to 
this underlying memory.
    --- End diff --
    
    "This operation has no impact on the reference count of this DrillBuf."
    Is this true only if the provided allocator is different from the current 
one?


> Incorporate remaining patches from DRILL-1942 Allocator refactor
> ----------------------------------------------------------------
>
>                 Key: DRILL-4134
>                 URL: https://issues.apache.org/jira/browse/DRILL-4134
>             Project: Apache Drill
>          Issue Type: Sub-task
>          Components: Execution - Flow
>            Reporter: Jacques Nadeau
>            Assignee: Jacques Nadeau
>             Fix For: 1.4.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to