草庐IT

stack-trace

全部标签

c++ - 段错误 : stack overflow

这个问题在这里已经有了答案:Segmentationfaultonlargearraysizes(7个答案)关闭5年前。以下发生在linux2.6.32-220.7.1.el6.x86_64和g++4.4.6中。以下代码:#include#includeintPROB_SIZE=10000000;usingnamespacestd;intmain(intargc,char*argv[]){unsignedintnumbers[PROB_SIZE];cout产生以下SIGSEGV:(gdb)运行启动程序:/home/cpd20202/sorting/errorProgramreceive

C++ - "Stack automatic"是什么意思?

在我浏览互联网时,我遇到了thispost,其中包括这个"(Wellwritten)C++goestogreatlengthstomakestackautomaticobjectswork"justlike"primitives,asreflectedinStroustrup'sadviceto"doastheintsdo".ThisrequiresamuchgreateradherencetotheprinciplesofObjectOrienteddevelopment:yourclassisn'trightuntilit"workslike"anint,followingthe"

c++ - ISO C++ 禁止声明没有类型的 'Stack"

我已经设置了以下头文件来创建一个使用数组的堆栈。我在第7行得到以下内容:error:ISOC++forbidsdeclarationof'Stack"withnotype.我以为类型是输入值。感谢你的帮助。谢谢你。#ifndefARRAYSTACKER_H_INCLUDED#defineARRAYSTACKER_H_INCLUDED//ArrayStacker.h:headerfileclassArrayStack{intMaxSize;intEmptyStack;inttop;int*items;public:Stacker(intsizeIn);~Stacker();voidpus

c++ - 如何在 for 循环中迭代 `std::stack` 个元素?

这个问题在这里已经有了答案:Doesstd::stackexposeiterators?(5个答案)关闭7年前。我正在编写一个FIR滤波器,它应该计算runningaverage输入序列的。classRunningAverager{public:RunningAverager(uint64_tFilterOrder){for(uint64_ti=0;i::const_referenceref=Registers.begin();ref!=Registers.end();???){//begin()andend()methodsdonotexistforstd::stack//Sum+=

c++ - 增加 Stack Size 的缺点以及 Stack Commit 和 Reserve 之间的区别

我最近遇到了DinkumwareC++11的堆栈溢出问题库,到目前为止,我已经通过将StackCommit和StackReserve大小加倍来解决这个问题(我还没有遇到任何问题)。但是,我很好奇增加堆栈大小是否有任何缺点,而且,我不完全确定StackCommit和StackReserve之间的区别是什么(但是堆栈提交要小得多比堆栈保留)。 最佳答案 增加堆栈大小的明显后果是更多的内存使用。由于在大多数情况下堆栈与总内存相比并不大,所以这不是大问题。显然,如果有许多线程每个都使用大堆栈,那么这可能会占用机器中的大量可用内存-特别是如果

c++ - unique_ptr 和 OpenSSL 的 STACK_OF(X509)*

我使用一些using语句和unique_ptr来与OpenSSL一起工作,如suggestedinanotherquestion.否则,代码会变得非常丑陋,而且我不太喜欢goto语句。到目前为止,我已经尽可能地更改了我的代码。以下是我使用的示例:usingBIO_ptr=std::unique_ptr;usingX509_ptr=std::unique_ptr;usingEVP_PKEY_ptr=std::unique_ptr;usingPKCS7_ptr=std::unique_ptr;...BIO_ptrtbio(BIO_new_file(some_filename,"r"),::

c++ - 警告 C4673 : throwing 'ex::traced_error<EX>' the following types will not be considered at the catch site

MSVC10和MSVC9在编译我的异常框架时都生成了4级警告消息,尽管程序的行为似乎是正确的。异常框架相当庞大和复杂,但我已经设法将其归结为它的本质。这是一个完整的程序,您可以在VS10中编译和运行#include#include#include#include#includeusingnamespacestd;namespaceex{classgeneric_error:virtualpublicstd::exception{public:generic_error(intthread_id):thread_id_(thread_id){}constchar*what()constt

ios - Xcode 6.3.2 : Instruments keep asking for trace template?

我一直在尝试使用Xcode中提供的各种Instruments来检查内存泄漏和使用我的应用程序时遇到的一些延迟。但是,尽管看了几个教程。每次尝试使用Xcode时,我都会收到错误消息。开始测试时,一个面板向我致意,提示我选择一种仪器。在选择TimeProfiler之后,我点击了Choose,并立即出现了以下屏幕提示:这通常不是我在任何教程中看到的内容。这也是问题开始的地方。无论我选择什么,或者我选择用什么仪器导入数据,我总是会遇到以下错误:有人告诉我应该重新安装Xcode。因此,在删除应用程序并重新安装后,我再次尝试。同样的错误。我也尝试过在线寻找解决方案。我只找到了thissimilar

ios - Q :Get rows count by indexPath of tableView comes `Trying to put the stack in unreadable memory at:` error

在我的tableView委托(delegate)方法中:我在tableViewdelegate方法中得到了numberOfRows和numberOfSections:-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath和-(CGFloat)tableView:(UITableView*)tableViewheightForRowAtIndexPath:(NSIndexPath*)indexPath,但是在-(NSInteger)tableView

ios - 自动布局 : how to set the hugging & resistance priority for two multi-line UILabel stacked vertically?

我已经使用像这样的自动布局实现了自定义单元格:如您所见,它有4个部分:[thumbnail,title,summary,feedName]。我需要精美地布置title和summary。它们都是多行UILabel。我需要实现的是,当文本过多时,摘要的行数先减少,然后是标题的行数,而不是像图片显示的那样(标题只占一行)。我试过像这样设置拥抱和抵抗的优先级,但它不起作用,有什么想法吗?标题:总结: 最佳答案 似乎我需要始终为多行标签设置preferredMaxLayoutWidth,甚至它的宽度也可以通过对周围View的约束来计算。通过设