stack

How to automatically call a method after popping a view controller off the stack on the iPhone

I need to update the parent view on an iPhone after popping a child view off the navigation stack. How can I setup the parent view to be notified or receive an automatic method call when the child is popped off the stack and the parent becomes visible again? The user enters data on the child page that I want to display on the parent pa...

How does a stackless language work?

I've heard of stackless languages. However I don't have any idea how such a language would be implemented. Can someone explain? ...

Assembly: Y86 Stack and call, pushl/popl and ret instructions

Hi, Unless I copied it wrong, the code above was written in the blackboard in a class by a student with the help/corrections of the teacher: int array[100], sum, i; void ini() { for(i = 0; i < 100; i++) array[i] = i; } int main() { ini(); sum = 0; for(i = 0; i < 100; i++) sum += array[i]; } .pos 0 irmovl Stack, %...

Do I understand the stack properly in this Y86 Assembly code?

I've created this simple and pointless assembly (Y86) code to see if I understand everything that's happening in the stack when the instructions call, pushl, popl and ret are used. Like I said, this code is pointless, it's just for testing/learning purposes. Although, all memory addresses were correctly (hopeful) calculated and are not ...

How do you change default stack size for managed executable.net

We have discovered that one of our auto generated assemblies is throwing a StackOverflowException on new(). This class has (bear with me please) 400+ simple properties that are initialised (most by default(string) etc) in a constructor. We notice that its fine on 64 bits but on 32 bits it goes bang! We need to test if it's reasonable ...

Determining which code line threw the exception

In dotNet a line throws an exception and is caught, how can I figure out which line in which file threw the exception? Seems relatively straightforward, but I can't figure it out... ...

Is it on the Stack or Heap?

I have some C code that is something of a puzzle. For a reason to do with this code, I'm wondering how I can tell if a struct object is ending up on the heap or stack? The objects are not being created with malloc or calloc. They start their life in the form of an array. For the purposes of this post, I'm going to call the struct Emp. ...

Stack allocation, padding, and alignment

I've been trying to gain a deeper understanding of how compilers generate machine code, and more specifically how GCC deals with the stack. In doing so I've been writing simple C programs, compiling them into assembly and trying my best to understand the outcome. Here's a simple program and the output it generates: asmtest.c: void main...

Why not use pointers for everything in C++?

Suppose that I define some class: class Pixel { public: Pixel(){ x=0; y=0;}; int x; int y; } Then write some code using it. Why would I do the following? Pixel p; p.x = 2; p.y = 5; Coming from a Java world I always write: Pixel* p = new Pixel(); p->x = 2; p->y = 5; They basically do the same thing, right? O...

Java Object Method Stack Frame Parameters

So in java, say you have a non-static method 'bar()' in an class 'Foo'. class Foo { private int m_answer; public Foo() { m_answer = -1; } public void bar(int newAnswer) { m_answer = newAnswer; } } Say then that you call this method like so: Foo myFoo = new Foo(); myFoo.bar(42); Now the...

What is the best server stack/configuration for Rails SaaS app

What would you suggest as the best server stack for a dedicated server which needs to host Rails SaaS application (not a lot of traffic but need to keep options open for future). ...

How to mmap the stack for the clone() system call on linux?

The clone() system call on Linux takes a parameter pointing to the stack for the new created thread to use. The obvious way to do this is to simply malloc some space and pass that, but then you have to be sure you've malloc'd as much stack space as that thread will ever use (hard to predict). I remembered that when using pthreads I didn...

Node-based stack class (need peer review)

I recently wrote a node-based stack class, per instructions (specs in the comments before the code, taken from the forum post). I was told to post it here for review by one of the friendlier members of the SO community, so here it is. For simplicity's sake: I put the definitions with the implementation. I understand when to use header fi...

Tree traversal without recursive / stack usage (C#) ?

Hi folks. I'm working with WPF and I'm developing a complex usercontrol, which is composed of a tree with rich functionality etc. For this purpose I used a View-Model design pattern, because some operations couldn't be achieved directly in WPF. So I take the IHierarchyItem (which is a node and pass it to this constructor to create a tree...

How to check the current state of thread stack

i have a probably stack overflow in my application (off course, only in release mode...), and would like to add some protection/investigation code to it. i am looking for a windows API to tell me the current state of a thread stack (i..e, the total size and used size). anyone ? thx Noam ...

Uninitialised values of heap and stack space

Why is the heap space always set to zero?? Why is stack space similarly not set to zero?? ...

Order of local variable allocation on the stack

Take a look at these two functions: void function1() { int x; int y; int z; int *ret; } void function2() { char buffer1[4]; char buffer2[4]; char buffer3[4]; int *ret; } If I break at function1() in gdb, and print the addresses of the variables, I get this: (gdb) p &x $1 = (int *) 0xbffff380 (gdb) p...

.NET developer looking to work on a LAMP stack, need help with workstation environment.

My main development, and workstation, is on an MS stack in .NET. I'm using IIS for my web endeavors, and everything works great. However, I have a need to be able to work on and test on a LAMP stack for various reasons. I have various clients that are running on LAMP stacks and need help with projects. My question is, given that I do...

What is a stack overflow?

What is a stack overflow error? What type of programs/programming languages is it likely to occur in? Is it unlikely to occur in web application code? ...

(C#) Arrays, heap and stack and value types

int[] myIntegers; myIntegers = new int[100]; In the above code, is new int[100] generating the array on the heap? From what I've read on CLR via c#, the answer is yes. But what I can't understand, is what happens to the actual int's inside the array. As they are value types, I'd guess they'd have to be boxed, as I can, for example, pas...