Quote:
Originally Posted by Mi4uric3
Nice, if you use smart pointers (1st post) this could solve many memory leak and performance problems :)
|
Now it's easy to transform an existing program #includeing header files to consume modules
Code:
import std.vector; // #include <vector>
import std.string;//
import struct_x #include an specific struct from default library
This new features increase performance and reduce compile speed.
You allocate memory on the heap, regardless of the fact you do it with new, new[], or the c memory allocation functions like malloc, you are responsible for cleaning it up by calling the appropriate delete or free.
Since that programmers mixing c and c++ codes. YES , memory LEAKED.
All kinds of smart pointers, enforce the different ownership models, they all reside in the memory header///==/=/=/=//.-.-.-.-='
-_-
I already solved problems with memory leak.

uuh
LOVE C++1z
And i already remover free from libthecore.
Here's an example for memory leak.
Code:
static void buffer_pool_free()
{
for (int i = 31; i >= 0; i--)
{
if (normalized_buffer_pool[i] != NULL)
{
LPBUFFER next;
for (LPBUFFER p = normalized_buffer_pool[i]; p != NULL; p = next)
{
next = p->next;
free(p->mem_data);
free(p);
}
normalized_buffer_pool[i] = NULL;
}
}
}
See? Free(p)