Questions tagged [heap]
The heap tag has no summary.
59 questions
1
vote
3
answers
380
views
What is the standard for heap allocators in bare metal programs?
What is the standard for heap allocation systems in bare metal programs? If there is no standard, what is the most popular one? Is it a free list? If so, are there heuristics that use a hash table of ...
1
vote
0
answers
466
views
Implementing a memory efficient Abstract Syntax Tree
I am writing a compiler in C++ 20. I am looking for ways to improve heap memory performance. For example, I can compile a 36.8 MB source file that is just many repeating lines of:
let x0: string = &...
-2
votes
2
answers
303
views
How does Java and other managed languages achieve any performance, if everything is allocated at random places of the heap? [closed]
Prelude
Recently, I helped a friend of mine in coding him a problem for his university Algorithms course, where problems are submitted in Java. I sent him code with good O notation complexity, ...
0
votes
0
answers
102
views
What is the Big O notation of modifying an existing element in a heap data structure?
Wikipedia says "increase key" is O(log n) for a binary heap, but it is referring to an internal function. I'm not asking about that: Imagine the data structure had an external/public ...
2
votes
4
answers
926
views
Could a language allow for persistent allocations without heap?
Is it possible in theory to have a programming language that allows for object lifetimes that exist beyond the current scope but without using heap?
As a little background, in embedded development it ...
6
votes
2
answers
2k
views
Why would you use 'new' and 'delete' for something that will be referenced through a vector?
I'm going through some code from this article about ECS-systems in game programming and trying to understand it, and something I'm seeing a lot is using heap memory in places where it seems like ...
4
votes
1
answer
3k
views
If a code inspection tool finds a "heap inspection" vulnerability, is that relevant if the code is for a web app running on a private server?
Recently, at the organization I work for, we've been using a static code inspection tool.
One of the more interesting findings is that private information, such as passwords, may be stored in the heap ...
2
votes
2
answers
2k
views
How can the size of a heap be less than its length?
I am studying the heap sort algorithm from the book Introduction to Algorithms by Thomas H. Corman. It differentiates between the length of the array, A.length, as
"the number of elements in the ...
2
votes
5
answers
6k
views
Do all threads share the same instance of a heap variable, or have different instances of a heap variable? [closed]
Computer Systems: a Programmer's Perspective says:
12.4.2 Mapping Variables to Memory
Variables in threaded C programs are mapped to virtual memory
according to their storage classes:
Global ...
0
votes
1
answer
181
views
Which scope should markers for a Stack Allocator fall under?
For reference, I am reading from "Game Engine Architecture 2nd Edition" by Jason Gregory.
Although I understand the theory behind Stack Allocators, I am having trouble implementing it fully. ...
25
votes
3
answers
4k
views
Are the Stack and Heap hardware, OS, or language-specific concepts?
In languages such as C or Java we have the concepts of the Stack and the Heap.
Are these abstractions the particular language runtime/compiler creates over the plain-old RAM? Or are these concepts ...
0
votes
4
answers
9k
views
Is it a good idea to use strings in a struct as values to static properties?
I'm in a discussion with a co-worker concerning the use of structs. I have a couple of structs that contain several static properties that are used throughout our website. The value of those ...
1
vote
2
answers
2k
views
Should I always allocate QObject and derived classes to the heap?
I was in #Qt irc channel, and I showed a small snippet of my code in a style that I heavily rely upon. It looks like this:
/* Get Reply from Server */
QPointer<QNetworkReply> reply;
{
...
-1
votes
1
answer
158
views
Algorithm for graphing heap data from server memory, over long period of time
Right now I am collecting memory information on a node.js server every 100 seconds. I want do display the memory usage info as a graph on the front end.
const mem = {
heapTotals: [],
heapUseds: []...
4
votes
1
answer
961
views
C++ Are members of a class pointer automatically on heap?
Let's say we have a struct Vector2i { int x = 0, int y = 0 };
And create a Pointer to it via Vector2i* pointer = new Vector2i;
Where would int x and int y be stored? Heap or stack?
Are all members ...