Hi, I have a big amount of data in a project that needs be written. To be exact, I need to write 16 x 16 x 16 x 64 x 90 = 23 Megabytes.
My original idea was creating a ValueTree, since it’s an structure of classes and subclasses. However it last around 300 seconds into creating the ValueTree and convert it to binary (more when I read the binary). Too much. Then I tried to write a MemoryBlock with the lastes 64 x 90 bytes.
This is the function I’m using to write it:
` MemoryBlock memBlock;
for (int8 i=0; i<64; ++i)
{
const Car* const currentCar= m_cars.getUnchecked(i);
for (int8 j=0; j<90; ++j)
{
const int8 currentProp = currentCar->getProperties(j);
memBlock.append(¤tProp, 1); // Maybe this is CRAZY!!
}
}
}
ValueTree tree("AllCars");
tree.setProperty("S", memBlock, 0); // I will write few more properties later, but only a bunch.
And this one is how I read it once I convert the root MemoryBlock to a ValueTree:
const var* const properties = tree.getPropertyPointer("S");
MemoryBlock memblock(properties, 64*90); // Again, maybe this is crazy too,
// but I cannot figure myself how to do it
int32 index = 0;
for (int8 i=0; i<64; ++i)
{
Car* const currentCar = m_cars.getUnchecked(i);
for (int8 j=0; j<90; ++j)
{
const int8 xx = memblock[index];
currentCar->setProperty(j, xx);
++index;
}
}
While the writting to the memory Block is much faster than saving a ValueTree with lots of properties and child, it crashes with the loading code [in memcpy.asm], and I cannot figure the reason. Please, could you help me?


