Top "Malloc" questions

The malloc function performs dynamic memory allocation in C and is part of the standard library.

'strcpy' with 'malloc'?

Is it safe to do something like the following? #include <stdio.h> #include <malloc.h> #include &…

c malloc strcpy
malloc implementation?

I'm trying to implement malloc and free for C, and I am not sure how to reuse memory. I currently …

c memory-management malloc free
malloc vs mmap in C

I built two programs, one using malloc and other one using mmap. The execution time using mmap is much less …

c malloc mmap
malloc() vs. HeapAlloc()

What is the difference between malloc() and HeapAlloc()? As far as I understand malloc allocates memory from the heap, just …

c++ winapi malloc
Why does malloc not work sometimes?

I'm porting a C project from Linux to Windows. On Linux it is completely stable. On Windows, it's working well …

c windows segmentation-fault malloc porting
sprintf() with automatic memory allocation?

I'm searching for a sprintf()-like implementation of a function that automatically allocates required memory. So I want to say …

c malloc printf
How does jemalloc work? What are the benefits?

Firefox 3 came with a new allocator: jemalloc. I have heard at several places that this new allocator is better. The …

firefox malloc
Segfaults in malloc() and malloc_consolidate()

My application segfaults sometimes and mainly in malloc() and malloc_consolidate() when I look at the backtrace in gdb. I …

c++ debugging malloc segmentation-fault
Difference between array type and array allocated with malloc

Today I was helping a friend of mine with some C code, and I've found some strange behavior that I …

c arrays malloc variable-length-array
Code for malloc and free

Where can I find the code for malloc my gcc compiler is using at the moment? I actually want to …

c linux malloc free