的std :: allocate_shared< T>没有正确对齐分配T. [英] std::allocate_shared<T> is not allocating T with correct alignment

查看:221
本文介绍了的std :: allocate_shared< T>没有正确对齐分配T.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

std :: allocate_shared< T>(alignedallocator< T>(),std :: forward< TYPES>(Args)...)

std::allocate_shared<T>(alignedallocator<T>(), std::forward<TYPES>(Args)...)

未分配std :: shared_ptr的< T>即使与根据对齐分配的分配器一起使用时,也能正确对齐T.我认为这是因为  _Ref_count_obj_alloc< T,alignedallocator< T>>没有正确的对齐。

is not allocating std::shared_ptr<T> with correct alignment of T even when used with allocator which allocates according to alignment. I think this is because _Ref_count_obj_alloc<T,alignedallocator<T>> does not have correct alignment.

我的视觉工作室版本是2017.3(版本15.3.1)

My visual studio version is 2017.3 (version 15.3.1)

推荐答案

您好,

一般声明,即std函数无法正常运行,无法证明或
可验证。

general statements that a std function does not function correctly, are not provable or verifiable.

向我们展示您的代码,我们可以检查您是否正确或出了什么问题在你的代码中。

Show us your code and we can check if you are right or what is wrong in your code.

问候,Guido


这篇关于的std :: allocate_shared&LT; T&GT;没有正确对齐分配T.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆