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

    https://github.com/apache/spark/pull/5868#discussion_r29814633
  
    --- Diff: 
unsafe/src/main/java/org/apache/spark/unsafe/memory/TaskMemoryManager.java ---
    @@ -175,12 +175,8 @@ public void free(MemoryBlock memory) {
        * This address will remain valid as long as the corresponding page has 
not been freed.
        */
       public long encodePageNumberAndOffset(MemoryBlock page, long 
offsetInPage) {
    -    if (inHeap) {
    -      assert (page.pageNumber != -1) : "encodePageNumberAndOffset called 
with invalid page";
    -      return (((long) page.pageNumber) << 51) | (offsetInPage & 
MASK_LONG_LOWER_51_BITS);
    -    } else {
    -      return offsetInPage;
    -    }
    +    assert (page.pageNumber != -1) : "encodePageNumberAndOffset called 
with invalid page";
    +    return (((long) page.pageNumber) << 51) | (offsetInPage & 
MASK_LONG_LOWER_51_BITS);
    --- End diff --
    
    i think everywhere we use a magic number like 51, we should have a very 
brief comment around it to say what that is


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to