Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
3 answers
2k views

How is a program stored before compiling?

When we write code, after compilation the code will be converted to machine language and then stored in the hard disk. But before compiling the code, it is still in the high-level language. How and ...
vinter's user avatar
  • 119
1 vote
1 answer
530 views

Coalescing by register allocation

I have a rough idea of what coalescing in terms of memory access by threads is, but now, when learning about compilers, the term coalescing also appears when talking about register allocation. In my ...
dsax7's user avatar
  • 157
69 votes
12 answers
13k views

Why don't compilers automatically insert deallocations?

In languages like C, the programmer is expected to insert calls to free. Why doesn't the compiler do this automatically? Humans do it in a reasonable amount of time(ignoring bugs), so it is not ...
Milton Silva's user avatar
2 votes
3 answers
275 views

How are variables accessed in the correct order from the stack?

I'm learning about the stack but one thing I am unable to understand is how variables can be accessed in the correct order. So if I had a basic program calculating the sum of some user entered values ...
Simon S's user avatar
  • 21
5 votes
0 answers
208 views

How are weak references in a reference counted system implemented?

When reference counting is used for automatic memory management (e.g. Objective C or Swift), it is well know that “loops” give problems. E.g. ...
Ian Ringrose's user avatar
7 votes
1 answer
318 views

Tag-free garbage collection for object oriented languages

I'm looking around for a good garbage collection technique for my language and found this paper, where Benjamin Goldberg describes a garbage collection technique for strongly typed languages, which ...
MathiasVP's user avatar
0 votes
1 answer
155 views

How Does Dynamic Heap Storage Have Something to Do with Heap?

There are three typical ways to allocate memory for programs: static, stack and dynamic heap. However, when I look at the implementation of dynamic heap memory allocation from wikipedia , what I found ...
Strin's user avatar
  • 1,505
5 votes
1 answer
7k views

Program compilation and execution flow

I was studying operating system concepts from Silberschatz, Galvin and Gagne's book (sixth edition) and I have some questions about the flow of execution of a program. A figure explains the processing ...
Rebooting's user avatar
  • 153
7 votes
3 answers
386 views

Are compilers able to detect alternating accesses to arrays and interleave them in memory?

Is it possible to design a compiler which optimizes a loop in which arrays are accessed in alternate fashion? For example like this: ...
krammer's user avatar
  • 305