python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Why i have to assign NULL to pointer after freeing allocated memory?
My question is why i have to assign NULL to pointer after freeing allocated memory?
free(*ptr);
*ptr = NULL;
I mean situation like this, why it is necesssary?
MASTERSI PL
Votes: 0
Answers: 0
How to solve a iterative slots allocation problem (points motion)
I am starting a project which involves an allocation problem, and having explored a bit by myself, it is pretty challenging for me to solve it efficiently.
What I call here allocation problem is the f...
yvrob
Votes: 0
Answers: 0
How does this kmalloc() function works?
I am reading the JamesM's kernel development tutorial and in the "chapter" that explain how to setup the paging memory management mechanism, he shows the kmalloc() function, that should allo...
Francesco
Votes: 0
Answers: 2
How bad is to make frequent allocations, if we're talking on small objects?
For example there are poco class:
class Foo{/*code*/}
and decorator class
class FooWrapper
{
public FooWrapper (Foo wrapped)
{
Wrapped = wrapped;
}
public Foo Wrapped{get;...
refreezer
Votes: 0
Answers: 0