Set the BitVector memory to zero on allocation.

Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/f1a46e68
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/f1a46e68
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/f1a46e68

Branch: refs/heads/master
Commit: f1a46e687ba5572b1cc0c830a4ea787876d5ad7c
Parents: 45d6537
Author: Aditya Kishore <[email protected]>
Authored: Mon Aug 25 21:10:36 2014 +0530
Committer: Aditya Kishore <[email protected]>
Committed: Mon Aug 25 21:10:36 2014 +0530

----------------------------------------------------------------------
 .../src/main/codegen/templates/NullableValueVectors.java       | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/f1a46e68/exec/java-exec/src/main/codegen/templates/NullableValueVectors.java
----------------------------------------------------------------------
diff --git 
a/exec/java-exec/src/main/codegen/templates/NullableValueVectors.java 
b/exec/java-exec/src/main/codegen/templates/NullableValueVectors.java
index ec99e79..cb52841 100644
--- a/exec/java-exec/src/main/codegen/templates/NullableValueVectors.java
+++ b/exec/java-exec/src/main/codegen/templates/NullableValueVectors.java
@@ -114,6 +114,7 @@ public final class ${className} extends BaseValueVector 
implements <#if type.maj
   public boolean allocateNewSafe() {
     if(!values.allocateNewSafe()) return false;
     if(!bits.allocateNewSafe()) return false;
+    bits.zeroVector();
     mutator.reset();
     accessor.reset();
     return true;
@@ -123,6 +124,7 @@ public final class ${className} extends BaseValueVector 
implements <#if type.maj
   public void allocateNew(int totalBytes, int valueCount) {
     values.allocateNew(totalBytes, valueCount);
     bits.allocateNew(valueCount);
+    bits.zeroVector();
     mutator.reset();
     accessor.reset();
   }
@@ -171,6 +173,7 @@ public final class ${className} extends BaseValueVector 
implements <#if type.maj
   public void allocateNew() {
     values.allocateNew();
     bits.allocateNew();
+    bits.zeroVector();
     mutator.reset();
     accessor.reset();
   }
@@ -180,6 +183,7 @@ public final class ${className} extends BaseValueVector 
implements <#if type.maj
   public boolean allocateNewSafe() {
     if(!values.allocateNewSafe()) return false;
     if(!bits.allocateNewSafe()) return false;
+    bits.zeroVector();
     mutator.reset();
     accessor.reset();
     return true;
@@ -189,6 +193,7 @@ public final class ${className} extends BaseValueVector 
implements <#if type.maj
   public void allocateNew(int valueCount) {
     values.allocateNew(valueCount);
     bits.allocateNew(valueCount);
+    bits.zeroVector();
     mutator.reset();
     accessor.reset();
   }
@@ -198,6 +203,7 @@ public final class ${className} extends BaseValueVector 
implements <#if type.maj
    */
   public void zeroVector() {
     this.values.zeroVector();
+    this.bits.zeroVector();
   }
 
   @Override

Reply via email to