зеркало из https://github.com/microsoft/snmalloc.git
Remove some unneeded headers (#680)
* Removed unneeded headers This removes some unneeded headers from the headers. * Remove use of std::string This stack allocates and copies a c-string to replace the calls to std::string.
This commit is contained in:
Родитель
c77076983d
Коммит
97b7675670
|
@ -6,8 +6,6 @@
|
|||
#include "empty_range.h"
|
||||
#include "range_helpers.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace snmalloc
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "../pal/pal.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
|
||||
namespace snmalloc
|
||||
{
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "../pal/pal.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
|
||||
namespace snmalloc
|
||||
{
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
#include "../ds_core/ds_core.h"
|
||||
#include "flaglock.h"
|
||||
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
|
||||
namespace snmalloc
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
#include <string_view>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
|
||||
namespace snmalloc
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
namespace snmalloc
|
||||
{
|
||||
|
@ -439,9 +438,27 @@ namespace snmalloc
|
|||
depth);
|
||||
if (!(get_dir(true, curr).is_null() && get_dir(false, curr).is_null()))
|
||||
{
|
||||
auto s_indent = std::string(indent);
|
||||
print(get_dir(true, curr), (s_indent + "|").c_str(), depth + 1);
|
||||
print(get_dir(false, curr), (s_indent + " ").c_str(), depth + 1);
|
||||
// As the tree should be balanced, the depth should not exceed 128 if
|
||||
// there are 2^64 elements in the tree. This is a debug feature, and
|
||||
// it would be impossible to debug something of this size, so this is
|
||||
// considerably larger than required.
|
||||
// If there is a bug that leads to an unbalanced tree, this might be
|
||||
// insufficient to accurately display the tree, but it will still be
|
||||
// memory safe as the search code is bounded by the string size.
|
||||
static constexpr size_t max_depth = 128;
|
||||
char s_indent[max_depth];
|
||||
size_t end = 0;
|
||||
for (; end < max_depth - 1; end++)
|
||||
{
|
||||
if (indent[end] == 0)
|
||||
break;
|
||||
s_indent[end] = indent[end];
|
||||
}
|
||||
s_indent[end] = '|';
|
||||
s_indent[end + 1] = 0;
|
||||
print(get_dir(true, curr), s_indent, depth + 1);
|
||||
s_indent[end] = ' ';
|
||||
print(get_dir(false, curr), s_indent, depth + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include "../ds/ds.h"
|
||||
#include "freelist.h"
|
||||
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
|
||||
namespace snmalloc
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
#include "freelist_queue.h"
|
||||
|
||||
#include <new>
|
||||
|
||||
namespace snmalloc
|
||||
{
|
||||
class RemoteMessageAssertions;
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include "../ds_core/ds_core.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
|
||||
namespace snmalloc
|
||||
{
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include "../ds_core/ds_core.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
|
||||
namespace snmalloc
|
||||
{
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "test/xoroshiro.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "test/usage.h"
|
||||
#include "test/xoroshiro.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <snmalloc/snmalloc.h>
|
||||
#include <thread>
|
||||
|
|
Загрузка…
Ссылка в новой задаче