-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc++] Update the status for lwg-3120 #116772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-libcxx Author: helianthus (love1angel) ChangesCurrent implementation already have struct __initial_descriptor which saves the initial state. This path update the lwg 3120 issue latest status. Close #104274 Full diff: https://github.com/llvm/llvm-project/pull/116772.diff 1 Files Affected:
diff --git a/libcxx/docs/Status/Cxx23Issues.csv b/libcxx/docs/Status/Cxx23Issues.csv
index 1215f21985eb94..95ecccbd505aab 100644
--- a/libcxx/docs/Status/Cxx23Issues.csv
+++ b/libcxx/docs/Status/Cxx23Issues.csv
@@ -14,7 +14,7 @@
"`LWG2731 <https://wg21.link/LWG2731>`__","Existence of ``lock_guard<MutexTypes...>::mutex_type`` typedef unclear","2020-11 (Virtual)","|Complete|","5",""
"`LWG2743 <https://wg21.link/LWG2743>`__","P0083R3 ``node_handle`` private members missing ""exposition only"" comment","2020-11 (Virtual)","|Nothing To Do|","",""
"`LWG2820 <https://wg21.link/LWG2820>`__","Clarify ``<cstdint>`` macros","2020-11 (Virtual)","|Nothing To Do|","",""
-"`LWG3120 <https://wg21.link/LWG3120>`__","Unclear behavior of ``monotonic_buffer_resource::release()``","2020-11 (Virtual)","","",""
+"`LWG3120 <https://wg21.link/LWG3120>`__","Unclear behavior of ``monotonic_buffer_resource::release()``","2020-11 (Virtual)","|Nothing To Do|","",""
"`LWG3170 <https://wg21.link/LWG3170>`__","``is_always_equal`` added to ``std::allocator`` makes the standard library treat derived types as always equal","2020-11 (Virtual)","|Complete|","18",""
"`LWG3036 <https://wg21.link/LWG3036>`__","``polymorphic_allocator::destroy`` is extraneous","2020-11 (Virtual)","|Nothing To Do|","","Reverted by P2875R4"
"`LWG3171 <https://wg21.link/LWG3171>`__","LWG2989 breaks ``directory_entry`` stream insertion","2020-11 (Virtual)","|Complete|","14",""
|
the two example provided in https://cplusplus.github.io/LWG/issue3120 is also tested. example 1 provided#include <memory_resource>
int main()
{
char buffer[100];
{
std::pmr::monotonic_buffer_resource mr(buffer, 100, std::pmr::null_memory_resource());
mr.release();
mr.allocate(60); // A
}
{
std::pmr::monotonic_buffer_resource mr(buffer, 100, std::pmr::null_memory_resource());
mr.allocate(60); // B
mr.release();
mr.allocate(60); // C
}
} below is the test result, A, B, C is succeess.
example 2 providedstd::pmr::monotonic_buffer_resource mr(std::pmr::new_delete_resource());
for (int i=0; i < 100; ++i) {
mr.allocate(1); // D
mr.release();
} i tested it through this #include <memory_resource>
#include <print>
class MyPmr : public std::pmr::memory_resource {
public:
explicit MyPmr(std::pmr::memory_resource* upstream)
: m_upstream(upstream)
{
}
private:
void* do_allocate(size_t bytes, size_t align) override
{
std::println("allocate: {}, {}", bytes, align);
void* p = m_upstream->allocate(bytes, align);
return p;
}
void do_deallocate(void* p, size_t bytes, size_t align) override
{
std::println("deallocate: {}, {}, {}", p, bytes, align);
m_upstream->deallocate(p, bytes, align);
}
bool do_is_equal(memory_resource const& other) const noexcept override
{
return other.is_equal(*m_upstream);
}
private:
std::pmr::memory_resource* m_upstream;
};
int main()
{
MyPmr s { std::pmr::new_delete_resource() };
std::pmr::monotonic_buffer_resource mr { &s };
for (int i = 0; i < 100; ++i) {
mr.allocate(1); // D
mr.release();
}
} which output always
means we don't increase the next buffer size. |
9f81f28
to
2cd2342
Compare
Hi, @frederick-vs-ja, also, can you assign the lwg 3143 issue to me? I also working on this. thanks in advance |
Assigned. Also, I think we don't need to merge the I'm waiting for CI becoming all green... |
b7855bb
to
817a90e
Compare
Yes, I miss clicked on github ui, and now i have reset it to supposed to be. I'm new to this. sorry don't know merrge rule. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to add tests for https://wg21.link/LWG3120 ?
yes, so i changed to draft. need to add test here. |
6b4d394
to
f85e051
Compare
1bdb206
to
f30ce1a
Compare
.../mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/release_reset_initial_status.pass.cpp
Show resolved
Hide resolved
.../mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/release_reset_initial_status.pass.cpp
Outdated
Show resolved
Hide resolved
.../mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/release_reset_initial_status.pass.cpp
Outdated
Show resolved
Hide resolved
f30ce1a
to
b3b9051
Compare
.../mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/release_reset_initial_status.pass.cpp
Outdated
Show resolved
Hide resolved
// Given | ||
// when init given a buffer, after release(), initial ptr will reset to it's initial state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't understand what this comment is trying to tell me. Could you formulate this in full sentences?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you've addressed this.
.../mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/release_reset_initial_status.pass.cpp
Outdated
Show resolved
Hide resolved
.../mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/release_reset_initial_status.pass.cpp
Outdated
Show resolved
Hide resolved
.../mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/release_reset_initial_status.pass.cpp
Outdated
Show resolved
Hide resolved
.../mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/release_reset_initial_status.pass.cpp
Outdated
Show resolved
Hide resolved
b3b9051
to
0a5b101
Compare
666753a
to
2c59de5
Compare
.../mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/release_reset_initial_status.pass.cpp
Outdated
Show resolved
Hide resolved
2c59de5
to
1a78af3
Compare
Current implementation already have struct __initial_descriptor which saves the initial state. When release() called, we will reset ptr __initial_descriptor.__cur_, next buffer size never changed. This patch update the lwg 3120 issue latest status and add test.
1a78af3
to
8593368
Compare
.../mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/release_reset_initial_status.pass.cpp
Show resolved
Hide resolved
…ffer/mem.res.monotonic.buffer.mem/release_reset_initial_status.pass.cpp
@love1angel Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR. Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues. How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/51/builds/13252 Here is the relevant piece of the build log for the reference
|
Current implementation already have struct __initial_descriptor which saves the initial state.
When release() called, we will reset ptr __initial_descriptor._cur.
This patch update the lwg 3120 issue latest status.
Close #104274