diff --git a/src/xrCore/xrstring.cpp b/src/xrCore/xrstring.cpp index 76c2ba93237..27adbc648da 100644 --- a/src/xrCore/xrstring.cpp +++ b/src/xrCore/xrstring.cpp @@ -6,7 +6,6 @@ #include "FS_impl.h" XRCORE_API extern str_container* g_pStringContainer = NULL; -#define HEADER 16 // ref + len + crc + next #if 1 @@ -153,7 +152,7 @@ str_value* str_container::dock(str_c value) // calc len u32 s_len = xr_strlen(value); u32 s_len_with_zero = (u32)s_len + 1; - VERIFY(HEADER + s_len_with_zero < 4096); + VERIFY(sizeof(str_value) + s_len_with_zero < 4096); // setup find structure char header[sizeof(str_value)]; @@ -177,7 +176,7 @@ str_value* str_container::dock(str_c value) ) { - result = (str_value*)Memory.mem_alloc(HEADER + s_len_with_zero + result = (str_value*)Memory.mem_alloc(sizeof(str_value) + s_len_with_zero #ifdef DEBUG_MEMORY_NAME , "storage: sstring" #endif // DEBUG_MEMORY_NAME @@ -294,7 +293,7 @@ str_value* str_container::dock(str_c value) // calc len u32 s_len = xr_strlen(value); u32 s_len_with_zero = (u32)s_len + 1; - VERIFY(HEADER + s_len_with_zero < 4096); + VERIFY(sizeof(str_value) + s_len_with_zero < 4096); // setup find structure char header[sizeof(str_value)]; @@ -328,7 +327,7 @@ str_value* str_container::dock(str_c value) // Insert string // DUMP_PHASE; - result = (str_value*)Memory.mem_alloc(HEADER + s_len_with_zero + result = (str_value*)Memory.mem_alloc(sizeof(str_value) + s_len_with_zero #ifdef DEBUG_MEMORY_NAME , "storage: sstring" #endif // DEBUG_MEMORY_NAME @@ -423,7 +422,7 @@ u32 str_container::stat_economy() const int node_size = 20; for (; it != end; it++) { - counter -= HEADER; + counter -= sizeof(str_value); counter -= node_size; counter += int((int((*it)->dwReference) - 1)*int((*it)->dwLength + 1)); }