The hash tables and vector blenlib headers were pulling many more headers than they actually need, including the C base math header, our C string API header, and the StringRef header. All of this potentially slows down compilation and polutes autocomplete with unrelated information. Also remove the `ListBase` constructor for `Vector`. It wasn't used much, and making it easy to use `ListBase` isn't worth it for the same reasons mentioned above. It turns out a lot of files depended on indirect includes of `BLI_string.h` and `BLI_listbase.h`, so those are fixed here. Pull Request: https://projects.blender.org/blender/blender/pulls/111801
27 lines
993 B
C++
27 lines
993 B
C++
/* SPDX-FileCopyrightText: 2023 Blender Foundation
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#include "BLI_string.h"
|
|
#include "BLI_vector.hh"
|
|
|
|
#include <iostream>
|
|
|
|
void blender::internal::vector_print_stats(const char *name,
|
|
void *address,
|
|
int64_t size,
|
|
int64_t capacity,
|
|
int64_t inlineCapacity,
|
|
int64_t memorySize)
|
|
{
|
|
std::cout << "Vector Stats: " << name << "\n";
|
|
std::cout << " Address: " << address << "\n";
|
|
std::cout << " Elements: " << size << "\n";
|
|
std::cout << " Capacity: " << capacity << "\n";
|
|
std::cout << " Inline Capacity: " << inlineCapacity << "\n";
|
|
|
|
char memory_size_str[BLI_STR_FORMAT_INT64_BYTE_UNIT_SIZE];
|
|
BLI_str_format_byte_unit(memory_size_str, memorySize, true);
|
|
std::cout << " Size on Stack: " << memory_size_str << "\n";
|
|
}
|