stack-memory Questions

2

Solved

I'm reading this book: "C von A bis Z". There is this example. /* ptr14.c */ #include <stdio.h> #include <stdlib.h> #include <string.h> /* Fehler: Funktion gibt die Adresse * e...
Insignificant asked 1/4, 2019 at 7:29

2

Solved

In books such as "C# in a Nutshell", what is allocated on the stack and heap is introduced quite quickly. However, C++ sources such as "Programming Principles and Practice Using C++", the standard,...
Billhook asked 15/3, 2019 at 8:3

1

Solved

Say I want to write a function that takes as input an array x of one dimension and returns another array y of the same dimension based on it (to ilustrate it I'm using a function that multiplies it...
Awaken asked 22/2, 2019 at 15:23

0

During an interview I was asked to outline the differences between structs and classes in Swift. Among my points, I made the argument that structs are stored in the stack (space for them is reserve...
Stepheniestephens asked 6/2, 2019 at 8:6

1

Solved

I thought I could get the beginning of my process stack by taking the address of a variable in main and rounding up to a page boundary (considering that my stack grows down). I compared this to the...
Vortex asked 5/2, 2019 at 21:51

1

Solved

I am new to MASM. I have confusion regarding these pointer registers. I would really appreciate if you guys help me. Thanks
Benton asked 24/1, 2019 at 12:27

2

Solved

I'm currently learning about operating systems and I learned that the stack is located between the kernel and the heap. What confuses me is that in most implementations, since the stack tends to gr...
Nertie asked 7/12, 2018 at 19:21

6

Solved

I am curious to know what happens when the stack and the heap collide. If anybody has encountered this, please could they explain the scenario.
Redmon asked 26/8, 2009 at 11:26

6

Solved

This may seem like a very basic question, but its been in my head so: When we allocate a local variable, it goes into stack. Similarly dynamic allocation cause the variable to go on heap. Now, my ...

3

Solved

What's the difference between kernel stack and user stack? Why kernel stack is used? If a local variable is declared in an ISR, where it will be stored? Does each process has its own kernel stack? ...

3

Solved

People talk about what the stack and heap are and the differences between them. But I am curious to know that if a CPU does not support stack and heap structure, then can C run properly without a s...
Langley asked 29/7, 2018 at 6:3

1

Solved

I want to use Hinnant's stack allocator (documentation, implementation) in combination with STL containers but I want to modify it such that dynamic memory allocation NEVER takes place. One thing...
Eighth asked 1/6, 2018 at 10:2

1

Solved

I found code to get the memory location for variables in the book Rust Essentials by Ivo Balbaert in chapter 2 about "Stack and Heap": let a = 32; let mut b = "str"; println!({:p} {:p}, &a, &a...
Moyer asked 30/5, 2018 at 4:40

2

Solved

I am a fairly experienced OpenMP user, but I have just run into a puzzling problem, and I am hopeful that someone here could help. The problem is that a simple hashing algorithm performs well for s...

3

while using the size command in Unix systems with the executable or object files, we get output in the form of the size of text segment and data segment. Why doesn't it show the output for heap or ...

3

Solved

I would like to use Nim in a soft-realtime context, where both memory allocation and garbage collection exhibit too much latency. Therefore, manual memory management is desirable- or, even better, ...

4

Solved

There is code like the following: int fun(){ char* pc = NULL; { char ac[100] = "addjfidsfsfds"; pc = ac; } ... pc[0] = 'd'; printf("%s\n", pc); ... } So, can I use pc safely after t...
Pharmacopoeia asked 30/3, 2018 at 2:7

1

Solved

I've read in different places that it is done for "performance reasons", but I still wonder what are the particular cases where performance get improved by this 16-byte alignment. Or, in any case, ...
Equalizer asked 20/3, 2018 at 17:48

2

Solved

I recently heard about the new C# Feature in 7.2, so that we now can return a reference of value type (for example int) or even a readonly reference of a value type. So as far as I know a value typ...
Edvard asked 19/3, 2018 at 8:13

3

Solved

I am in need of such a inline assembly code: I have a pair(so, it is balanced) of push/pop operation inside the assembly I also have a variable in memory (so, not register) as input like this:...
Filiation asked 18/2, 2018 at 16:11

7

Solved

C++ standard does not mention anything about the stack or the heap, they are implementation specific, which is true. Even though they are not part of the C++ standard, we end up using them anyway,...
Quadrumanous asked 5/6, 2012 at 16:12

8

Solved

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...
Shorts asked 11/7, 2009 at 14:30

3

I am currently learning x86 assembly. Something is not clear to me still however when using the stack for function calls. I understand that the call instruction will involve pushing the return addr...
Billy asked 12/10, 2017 at 16:30

1

While there is no officially supported way to do this. Is there a way (on modern systems), to detect if a pointer is from the stack (stack of the caller for example). Even if this is not going to ...
Burroughs asked 20/9, 2017 at 6:27

2

Solved

What are the differences between the Java memory spaces (Perm Space, Space Stack, Heap Space)? When does the JVM use one or another? If I use Scala/Groovy/etc., are there differences?
Krieg asked 23/7, 2011 at 16:13

© 2022 - 2024 — McMap. All rights reserved.