Skip to content

Commit e1829f7

Browse files
Addressing comments, trying to reduce build time for the CI script
Signed-off-by: Ujjwal Shekhar <ujjwal.shekhar@research.iiit.ac.in>
1 parent a62e2f1 commit e1829f7

5 files changed

Lines changed: 30 additions & 7 deletions

File tree

.github/workflows/linux_release_clang_p2996_reflection.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
shell: bash
4343
run: |
4444
cmake --build build --target all
45-
cmake --build build --target tests
45+
cmake --build build --target tests.unit.modules.serialization
4646
- name: Test
4747
shell: bash
4848
run: |

libs/core/serialization/include/hpx/serialization/brace_initializable_fwd.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99

1010
#include <hpx/config.hpp>
1111

12+
#if !defined(HPX_SERIALIZATION_HAVE_ALLOW_AUTO_GENERATE)
1213
namespace hpx::serialization {
1314

1415
HPX_CXX_CORE_EXPORT template <typename Archive, typename T>
1516
void serialize_struct(Archive& ar, T& t, unsigned int const);
1617
} // namespace hpx::serialization
18+
#endif

libs/core/serialization/include/hpx/serialization/detail/polymorphic_nonintrusive_factory.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Copyright (c) 2015 Anton Bikineev
33
// Copyright (c) 2015 Andreas Schaefer
44
// Copyright (c) 2022-2025 Hartmut Kaiser
5+
// Copyright (c) 2026 Ujjwal Shekhar
56
//
67
// SPDX-License-Identifier: BSL-1.0
78
// Distributed under the Boost Software License, Version 1.0.

libs/core/serialization/include/hpx/serialization/detail/polymorphic_nonintrusive_factory_impl.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright (c) 2014 Thomas Heller
2+
// Copyright (c) 2015 Anton Bikineev
3+
// Copyright (c) 2015 Andreas Schaefer
4+
// Copyright (c) 2022-2025 Hartmut Kaiser
15
// Copyright (c) 2026 Ujjwal Shekhar
26
//
37
// SPDX-License-Identifier: BSL-1.0

libs/core/serialization/include/hpx/serialization/detail/refl_qualified_name_of.hpp

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ namespace hpx::serialization::detail {
3232
{
3333
for (std::size_t i = 0; i < sv.size(); ++i)
3434
data[i] = sv[i];
35+
36+
data[sv.size()] = '\0';
37+
}
38+
39+
constexpr fixed_string(char const (&s)[N + 1]) noexcept
40+
{
41+
for (std::size_t i = 0; i < N; ++i)
42+
data[i] = s[i];
43+
44+
data[N] = '\0';
3545
}
3646

3747
template <std::size_t M>
@@ -42,10 +52,16 @@ namespace hpx::serialization::detail {
4252
res.data[i] = data[i];
4353
for (std::size_t i = 0; i < M; ++i)
4454
res.data[N + i] = other.data[i];
55+
56+
res.data[N + M] = '\0';
4557
return res;
4658
}
4759
};
4860

61+
// Deduction guide for fixed_string
62+
template <std::size_t N>
63+
fixed_string(char const (&)[N]) -> fixed_string<N - 1>;
64+
4965
// Helper to recursively build the enclosing namespaces of a type
5066
template <std::meta::info Scope>
5167
struct scope_builder
@@ -54,7 +70,7 @@ namespace hpx::serialization::detail {
5470
{
5571
if constexpr (Scope == ^^::)
5672
{
57-
return fixed_string<0>("");
73+
return fixed_string("");
5874
}
5975
else if constexpr (!std::meta::has_identifier(Scope))
6076
{
@@ -75,7 +91,7 @@ namespace hpx::serialization::detail {
7591

7692
if constexpr (prefix.size > 0)
7793
{
78-
return prefix + fixed_string<2>("::") + name;
94+
return prefix + fixed_string("::") + name;
7995
}
8096
else
8197
{
@@ -122,13 +138,13 @@ namespace hpx::serialization::detail {
122138
{
123139
if constexpr (sizeof...(Args) == 0)
124140
{
125-
return fixed_string<0>("");
141+
return fixed_string("");
126142
}
127143
else
128144
{
129145
// The lambda templ param trick allows this computation
130146
// to be done at compile time.
131-
// TODO: Is there a more elegant way to do this?
147+
// TODO: Is there a more elegant way to do this
132148
return []<std::size_t... Is>(std::index_sequence<Is...>) {
133149
return (... +
134150
(fixed_string<(Is == 0 ? 0 : 1)>(Is == 0 ? "" : ",") +
@@ -138,8 +154,8 @@ namespace hpx::serialization::detail {
138154
}
139155

140156
// Final string
141-
static constexpr auto storage = scoped_name + fixed_string<1>("<") +
142-
get_args_name() + fixed_string<1>(">");
157+
static constexpr auto storage = scoped_name + fixed_string("<") +
158+
get_args_name() + fixed_string(">");
143159

144160
public:
145161
[[nodiscard]] static constexpr char const* get() noexcept

0 commit comments

Comments
 (0)