commit after resolving conflict
[satune.git] / src / Encoders / naiveelementencoder.c
index 58f63ac..bb6e91a 100644 (file)
@@ -4,15 +4,20 @@
 #include "set.h"
 #include "common.h"
 #include "structs.h"
+#include <strings.h>
 
 void baseBinaryIndexElementAssign(ElementEncoding *This) {
        Element * element=This->element;
        Set * set=element->set;
        ASSERT(set->isRange==false);
        uint size=getSizeVectorInt(set->members);
-       This->encodingArray=ourmalloc(sizeof(uint64_t)*size);
+       uint encSize=NEXTPOW2(size);
+       allocEncodingArrayElement(This, encSize);
+       allocInUseArrayElement(This, encSize);
+
        for(uint i=0;i<size;i++) {
                This->encodingArray[i]=getVectorInt(set->members, i);
+               setInUseElement(This, i);
        }
-       This->type=BINARYINDEX;
 }
+