memcpy 似乎被卡住了

发布于 2024-09-12 00:01:54 字数 90 浏览 4 评论 0原文

我尝试使用大小为 200K 的 memcpy,但它卡住了!!!

destb 和 source 均已分配。

这个问题的原因可能是什么?

I am trying to use a memcpy for a size of 200K, and it stucks!!!

Both destb and source are allocated.

What could be the reason for this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷默言语 2024-09-19 00:01:54

尝试使用一些跟踪内存访问的工具。 Valgrind 是我最喜欢的一个。

如果您无法这样做,至少尝试将源和目标指针值打印到控制台,并确保它们实际上已分配、不重叠且大小正确。

Try using some tool that traces memory accesses. Valgrind is my favourite one.

If you're not able to do so, at least try printing out the source and dest pointer values to the console, and make sure they are in fact allocated, non-overlapping and of the right size.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文