willtemperley opened a new issue, #106:
URL: https://github.com/apache/arrow-swift/issues/106

   ### Describe the enhancement requested
   
   In `ArrowBuffer`, `alignTo64` always aligns to a multiple of 64 plus 8. I 
just can't think of a reason for this. The naming alignTo64 seems to point ot 
this being an oversight.
   
   ```swift 
   private static func alignTo64(_ length: UInt) -> UInt {
       let bufAlignment = length % 64
       if bufAlignment != 0 {
           return length + (64 - bufAlignment) + 8
       }
   
       return length + 8
   }
   ```
   
   Oddly this behaviour is tested for which indicates it might have been 
intentional but I really can't see a reason.
   
   ```swift
       func testPrimitiveArray() throws {
   .
           let arrayBuilder: NumberArrayBuilder<UInt8> = try 
ArrowArrayBuilders.loadNumberArrayBuilder()
           for index in 0..<100 {
               arrayBuilder.append(UInt8(index))
           }
   
           XCTAssertEqual(arrayBuilder.nullCount, 0)
           arrayBuilder.append(nil)
           XCTAssertEqual(arrayBuilder.length, 101)
           XCTAssertEqual(arrayBuilder.capacity, 136)
      }
   ```


-- 
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]

Reply via email to