mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-30 19:35:55 +00:00
cleanup: flatten dead branches in world io level network and stats
This commit is contained in:
@@ -33,12 +33,7 @@ SparseDataStorage::SparseDataStorage() {
|
||||
// MM_PHYSICAL_4KB_BASE upwards. We can use this fact to identify the
|
||||
// allocation later, and so free it with the corresponding call to
|
||||
// XPhysicalFree.
|
||||
#if 0
|
||||
unsigned char* planeIndices = (unsigned char*)XPhysicalAlloc(
|
||||
128 * 128, MAXULONG_PTR, 4096, PAGE_READWRITE);
|
||||
#else
|
||||
unsigned char* planeIndices = (unsigned char*)malloc(128 * 128);
|
||||
#endif
|
||||
unsigned char* data = planeIndices + 128;
|
||||
planeIndices[0] = ALL_0_INDEX;
|
||||
for (int i = 1; i < 128; i++) {
|
||||
@@ -52,7 +47,7 @@ SparseDataStorage::SparseDataStorage() {
|
||||
dataAndCount =
|
||||
0x007F000000000000L | (((int64_t)planeIndices) & 0x0000ffffffffffffL);
|
||||
|
||||
#ifdef DATA_COMPRESSION_STATS
|
||||
#if defined(DATA_COMPRESSION_STATS)
|
||||
count = 128;
|
||||
#endif
|
||||
}
|
||||
@@ -74,7 +69,7 @@ SparseDataStorage::SparseDataStorage(bool isUpper) {
|
||||
dataAndCount =
|
||||
0x0000000000000000L | (((int64_t)planeIndices) & 0x0000ffffffffffffL);
|
||||
|
||||
#ifdef DATA_COMPRESSION_STATS
|
||||
#if defined(DATA_COMPRESSION_STATS)
|
||||
count = 128;
|
||||
#endif
|
||||
}
|
||||
@@ -85,11 +80,6 @@ SparseDataStorage::~SparseDataStorage() {
|
||||
// Determine correct means to free this data - could have been allocated
|
||||
// either with XPhysicalAlloc or malloc
|
||||
|
||||
#if 0
|
||||
if ((unsigned int)indicesAndData >= MM_PHYSICAL_4KB_BASE) {
|
||||
XPhysicalFree(indicesAndData);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
free(indicesAndData);
|
||||
}
|
||||
@@ -118,7 +108,7 @@ SparseDataStorage::SparseDataStorage(SparseDataStorage* copyFrom) {
|
||||
|
||||
XMemCpy(destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128);
|
||||
|
||||
#ifdef DATA_COMPRESSION_STATS
|
||||
#if defined(DATA_COMPRESSION_STATS)
|
||||
count = sourceCount;
|
||||
#endif
|
||||
}
|
||||
@@ -432,7 +422,7 @@ void SparseDataStorage::addNewPlane(int y) {
|
||||
// Queue old data to be deleted
|
||||
queueForDelete(lastDataPointer);
|
||||
// printf("Marking for delete 0x%x\n", lastDataPointer);
|
||||
#ifdef DATA_COMPRESSION_STATS
|
||||
#if defined(DATA_COMPRESSION_STATS)
|
||||
count = linesUsed;
|
||||
#endif
|
||||
} else {
|
||||
@@ -474,11 +464,6 @@ void SparseDataStorage::tick() {
|
||||
// if( toFree ) printf("Deleting 0x%x\n", toFree);
|
||||
// Determine correct means to free this data - could have been allocated either
|
||||
// with XPhysicalAlloc or malloc
|
||||
#if 0
|
||||
if ((unsigned int)toFree >= MM_PHYSICAL_4KB_BASE) {
|
||||
XPhysicalFree(toFree);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
free(toFree);
|
||||
}
|
||||
@@ -515,7 +500,7 @@ void SparseDataStorage::updateDataAndCount(int64_t newDataAndCount) {
|
||||
}
|
||||
} while (!success);
|
||||
|
||||
#ifdef DATA_COMPRESSION_STATS
|
||||
#if defined(DATA_COMPRESSION_STATS)
|
||||
count = (newDataAndCount >> 48) & 0xffff;
|
||||
#endif
|
||||
}
|
||||
@@ -592,7 +577,7 @@ int SparseDataStorage::compress() {
|
||||
queueForDelete(planeIndices);
|
||||
// printf("Successfully compressed to %d planes, to delete
|
||||
//0x%x\n", planesToAlloc, planeIndices);
|
||||
#ifdef DATA_COMPRESSION_STATS
|
||||
#if defined(DATA_COMPRESSION_STATS)
|
||||
count = planesToAlloc;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user