stack

How to increase stack size for a thread in Qt - QThread::setStackSize() seems not to work?

主宰稳场 提交于 2019-12-11 13:08:46
问题 From the question: SQLite stack overflow when running a bulk INSERT OR REPLACE with 500 rows: why?, I need to increase the stack size for a certain thread in Qt. I would like this to be cross-platform, but I am initially starting by trying to get it working on Windows. Unfortunately, nothing I have tried to do successfully increases the stack size for the thread in question. (I measure the stack size by adding code to evaluate the current stack size (see link above), and observing that a

R - how to add cases of one variable to other variable (stack variables)

﹥>﹥吖頭↗ 提交于 2019-12-11 12:59:35
问题 var1 var2 var3 1 2 3 1 2 3 1 2 3 I want to stack var2 and var3 underneath var1 to get: var1 1 1 1 2 2 2 3 3 3 I tried: data$var <- append(data$var1,data$var2) Then I get an error that my replacement has more rows. How do I solve this? 回答1: df <- data.frame(var1=1:3,var2=4:6,var3=7:9) df2 <- stack(df) print(df2) values ind 1 1 var1 2 2 var1 3 3 var1 4 4 var2 5 5 var2 6 6 var2 7 7 var3 8 8 var3 9 9 var3 回答2: You may want to try unlist : dtf <- data.frame(a = 1:3, b = 1:3, c = 1:3) unlist(dtf)

Create temporary object as an argument on the stack [closed]

让人想犯罪 __ 提交于 2019-12-11 12:53:38
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . In any programming language without pointers with garbage collector I can do DrawLine(new Vector(0, 0), new Vector(100, 100)); But in C++ we can't if DrawLine is not responsible for deleting its arguments, so the shortest way to invoke DrawLine with two vectors (0,0) and (100,100) is: Vector v(0, 0); Vector w

How to make Stack.Pop threadsafe

一笑奈何 提交于 2019-12-11 12:21:08
问题 I am using the BlockingQueue code posted in this question, but realized I needed to use a Stack instead of a Queue given how my program runs. I converted it to use a Stack and renamed the class as needed. For performance I removed locking in Push, since my producer code is single threaded. My problem is how can thread working on the (now) thread safe Stack know when it is empty. Even if I add another thread safe wrapper around Count that locks on the underlying collection like Push and Pop do

call function with float in assembly x86 x87

♀尐吖头ヾ 提交于 2019-12-11 12:12:52
问题 I'm new to assembly programming and, as a part of a bigger program I have need to pass floating point values to another C-function. I have a call from my test program to my assembly function, that only pushes the parameters on the right stack, and calls a second C function. My C test function: extern void ext_func(char *result, double d); // C function extern double tester(char *str, float d); double a = tester(str, 3.14) printf("%s\n", str); // Resulting in '0.000000' // doing some fancy

How I get the value from the Immediate part of a 32 Bit sequence in C?

谁说胖子不能爱 提交于 2019-12-11 11:58:09
问题 I built a virtual machine in C. And for this I have the Instruction pushc <const> I saved the command and the value in 32 Bit. The First 8 Bit are for the command and the rest for the value. 8 Bit -> Opcode 24 Bit -> Immediate value For this I make a macro #define PUSHC 1 //1 is for the command value in the Opcode #define IMMEDIATE(x) ((x) & 0x00FFFFFF) UPDATE: **#define SIGN_EXTEND(i) ((i) & 0x00800000 ? (i) | 0xFF000000 : (i))** Then I load for testing this in a unsigned int array: Update:

Windows NT4 stack and heap address space

半世苍凉 提交于 2019-12-11 11:57:40
问题 I'm trying to search for an integer value in the stack and heap memory of Windows NT4. This integer is used by another program. The problem is I don't know the address range of the stack and heap, is there a way to find the range of this address space? Previously I've tried searching this integer value in the code space by using EnumProcessModules function of PSAPI (a windows api). From this function, I get the addresses containing the modules of the program which I can then search through to

How to access multiple instances of stack frame in C

余生长醉 提交于 2019-12-11 11:56:39
问题 I'm attempting to write a function that is called at the end of a recursive invocation of foo() . This function will access the stack frame to display all passed arguments into foo() at the time of each invocation. I am totally confused as to how I can access the stack frame in this manner. Appreciate any insights on the matter, thank you! 来源: https://stackoverflow.com/questions/33663546/how-to-access-multiple-instances-of-stack-frame-in-c

If the stack grows at numerically lower address why does pointer comparison reverses this?

血红的双手。 提交于 2019-12-11 11:33:37
问题 Since the stack grows downwards, ie towards numerically smaller memory addresses why does &i < &j is true. Correct me if I'm wrong, but I'd imagine this was a design decision of C creators (that C++ maintains). But I wonder why though. It is also strange that a heap-allocated object pin lies at numerically higher memory address than a stack variable and this also contradicts the fact that the heap lies at numerically smaller memory addresses than the stack (and increases upwards). #include

Unpack an array to the stack at runtime

本秂侑毒 提交于 2019-12-11 10:46:29
问题 I have an array: { 1 2 3 4 } I want to push its contents to the stack. I tried: (sc) { 1 2 3 4 } dup length firstn 1 2 3 4 Great! Inside a word, though: : explode ( a -- * ) dup length firstn ; inline Throws an error Cannot apply “firstn” to a run-time computed value , because firstn calls call and Words which call an input parameter must be declared inline so that a caller which passes in a literal quotation can have a static stack effect. ... and because of call 's semantics it's hard to