草庐IT

avcodec_alloc_context

全部标签

c++ - "std::bad_alloc": am I using too much memory?

消息:terminatecalledafterthrowinganinstanceof'std::bad_alloc'what():std::bad_alloc我查看了gdb回溯,这是我自己实现的最低级别的方法:/**getanarrayofvec3s,whichwillbeusedforrenderingtheimage*/vec3*MarchingCubes::getVertexNormalArray(){//UsedthesamearraysizetechniqueasgetVertexArray:wewantindicestomatchupvec3*array=newvec3[

c++ - 可以使用 boost::asio::thread_pool 来代替 boost::asio::io_context 与 boost::thread::thread_group 的组合吗?

我正在努力解决我的一些困惑。我偶然发现了boost::asio::thread_pool并且我认为可以使用以某种方式自动组合boost::asio::io_context和boost::thread::thread_group就像经常建议的那样(here或here)。似乎这个asio特定的池可用于post任务,但另一方面,一些网络类型,如resolver需要将对象io_context作为构造函数参数传递,而thread_pool不是也不是从该参数派生的。 最佳答案 假设你有一个单独的io_context对象,名为ioc。您可以创建多

c++ - C 中 'allocated object having no declared type' 的 C++ 等价物是什么?

我正在用C++为我的VM编写内存管理器。好吧,更准确地说,VM指令将使用嵌入式内存管理器编译成C++。我在处理C方面更加自如,但现在我确实需要对异常处理的原生支持,这几乎是我使用C++的唯一原因。C和C++都有严格的别名规则,即不兼容类型的两个对象不得重叠,C中的union有一个小异常(exception)。但要定义malloc、calloc、alloca等内存分配函数的行为,C标准有以下段落。6.5-6Theeffectivetypeofanobjectforanaccesstoitsstoredvalueisthedeclaredtypeoftheobject,ifany.Allo

c++ - 警告 C4316 : object allocated on the heap may not be aligned 16

重要信息:开发操作系统:Windows8.164位目标操作系统:Windows8.164位IDE:VisualStudio2013专业版语言:C++问题:通过IDE编译我的静态库项目时收到以下警告:warningC4316:...:objectallocatedontheheapmaynotbealigned16我可以简单地忽略此警告...但我假设它的存在是有原因的,并且希望至少了解它的含义以及它对future可能产生的影响。我认为这行代码与问题有关,在我的Win32窗口包装类中调用:m_direct3D=newDirect3D(this);m_direct3D是一个指向我的Direc

c++ - g++编译错误 "... is protected from within this context",而clang没有错误

我有以下代码:#includeclassBaseClass{protected:staticintx;};intBaseClass::x;classDerivedA:publicBaseClass{public:DerivedA(){x=3;}};classDerivedB:publicBaseClass{public:DerivedB(){std::cout使用g++编译(g++classtest.cpp)我收到以下错误:classtest.cpp:Inconstructor‘DerivedB::DerivedB()’:classtest.cpp:9:5:error:‘intBase

c++ - 为什么 std::allocator 在 C++17 中丢失了成员类型/函数?

在查看std::allocator时,我看到成员(member):value_type,指针,const_pointer,引用,const_reference,size_type,difference_type,以及rebind已全部弃用。分配器也将不再拥有成员:address、max_size、construct或destroy。为什么会这样?是否与多态分配器有关? 最佳答案 如果您查看therelevantisocpppaper你可以看到你提到的第一个集合现在被认为放在std::allocator_traits中更好。.自从ST

c++ - _CRTDBG_MAP_ALLOC 不显示文件名

我正在尝试检测内存泄漏,并且我正在使用make_CRTDBG_MAP_ALLOC宏来定位泄漏区域的位置。所以我定义MACRO如下:#ifdef_DEBUG#define_CRTDBG_MAP_ALLOC#include#include#defineDEBUG_NEWnew(_NORMAL_BLOCK,__FILE__,__LINE__)#definenewDEBUG_NEW#endif在我的代码中,我有:UINTSomeFunThread(LPVOIDpParam){_CrtMemStatecrtMemStateStart;_CrtMemStatecrtMemStateFinish;_

node.js - fatal error : Evacuation Allocation failed - process out of memory

无论我在我的ubuntu服务器上运行什么,我总是得到这个错误,有人知道为什么吗?fatalerror:疏散分配失败-进程内存不足$nodeapp.jsFATALERROR:EvacuationAllocationfailed-processoutofmemoryAborted(coredumped)$npminstallFATALERROR:EvacuationAllocationfailed-processoutofmemoryAborted(coredumped)$grunt-grunfileGruntfile-online.jsFATALERROR:Mallocedoperato

node.js - fatal error : CALL_AND_RETRY_LAST Allocation failed - process out of memory

Node版本为v0.11.13根据sudotop崩溃期间的内存使用量不会超过3%重现此错误的代码:varrequest=require('request')varnodedump=require('nodedump')request.get("http://pubapi.cryptsy.com/api.php?method=marketdatav2",function(err,res){vardataconsole.log("Datareceived.");data=JSON.parse(res.body)console.log("Dataparsed.");data=nodedump

docker - 为什么 Docker 构建在 "Sending context to daemon"步骤中需要很长时间?

我对Docker世界还很陌生。我正在运行这个命令:dockerbuild-tworker-fworker-Dockerfile-local.这是Docker文件的内容:FROMcentosMAINTAINERMyTeamRUN/usr/bin/getentgroupworker||/usr/sbin/groupadd-rworkerRUN/usr/bin/getentpasswdworker||/usr/sbin/useradd-r-gworker-s/sbin/nologinworker#INSTALLPIPRUNcurl"https://bootstrap.pypa.io/get-