Commit 75c6e770 authored by Ivan Donchevskiy's avatar Ivan Donchevskiy

Cleaning CycleStorage and TableBlockStorage if creating

parent 0a2068c0
...@@ -203,6 +203,8 @@ bool CycleStorage::create(const char* name, int inf_sz, int inf_count, int seek) ...@@ -203,6 +203,8 @@ bool CycleStorage::create(const char* name, int inf_sz, int inf_count, int seek)
if(fseek(file,seekpos,0)==-1) return false; if(fseek(file,seekpos,0)==-1) return false;
CycleStorageElem *jrn = (CycleStorageElem*)new char[full_size]; CycleStorageElem *jrn = (CycleStorageElem*)new char[full_size];
for( int i=0; i<full_size; i++ )
*((char*)jrn+i) = 0;
jrn->status=0; jrn->status=0;
/*! */ /*! */
...@@ -232,7 +234,8 @@ bool CycleStorage::addRow(void* str) ...@@ -232,7 +234,8 @@ bool CycleStorage::addRow(void* str)
if(file==NULL) return false; if(file==NULL) return false;
CycleStorageElem *jrn = (CycleStorageElem*)new char[full_size]; CycleStorageElem *jrn = (CycleStorageElem*)new char[full_size];
int i=0; int i=0;
for( i=0; i<full_size; i++ )
*((char*)jrn+i) = 0;
/*! 2 - (head=-1), 1 (head=tail=0) ) /*! 2 - (head=-1), 1 (head=tail=0) )
*/ */
......
...@@ -210,6 +210,9 @@ bool TableBlockStorage::create(const char* name, int key_sz, int inf_sz, int inf ...@@ -210,6 +210,9 @@ bool TableBlockStorage::create(const char* name, int key_sz, int inf_sz, int inf
/*! */ /*! */
mem = (TableBlockStorageElem*) new char[block_size*full_size]; mem = (TableBlockStorageElem*) new char[block_size*full_size];
for( i=0; i<block_size*full_size; i++ )
*((char*)mem+i) = 0;
StorageAttr sa; StorageAttr sa;
sa.k_size=k_size; sa.k_size=k_size;
sa.inf_size=inf_size; sa.inf_size=inf_size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment