Changes
[satune.git] / src / Encoders / elementencoding.c
index 8056812..08385db 100644 (file)
@@ -1,7 +1,7 @@
 #include "elementencoding.h"
 
 ElementEncoding * allocElementEncoding(ElementEncodingType type, Element *element) {
-       ElementEncoding * This=(ElementEncoding *)ourmalloc(sizeof(ElementEncoding));
+       ElementEncoding * This=ourmalloc(sizeof(ElementEncoding));
        This->element=element;
        This->type=type;
        This->variables=NULL;
@@ -15,6 +15,15 @@ void deleteElementEncoding(ElementEncoding *This) {
                ourfree(This->variables);
        if (This->encodingArray!=NULL)
                ourfree(This->encodingArray);
+       if (This->inUseArray!=NULL)
+               ourfree(This->inUseArray);
        ourfree(This);
 }
 
+void allocEncodingArrayElement(ElementEncoding *This, uint size) {
+       This->encodingArray=ourcalloc(1, sizeof(uint64_t)*size);
+}
+
+void allocInUseArrayElement(ElementEncoding *This, uint size) {
+       This->inUseArray=ourcalloc(1, size >> 6);
+}