Top "Malloc" questions

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

malloc( ): memory corruption (fast) error C++

I'm working in C++. I'm working on a method to change the maximum capacity of a stack and I'm confused …

c++ stack malloc glibc capacity
Sample example program to get the malloc consolidate error

I want to test the mcheck functionality on my PC first to detect the malloc consolidate error. This way, i …

c malloc valgrind embedded-linux uclibc
How to initialize static pointer with malloc in C?

I'm trying to initiate a static variable (inside a function) with malloc in C, but I'm getting the "initializer not …

c static malloc constants initializer
How does mmap work?

I am working on programs in Linux which needs mmap file from harddrive, but i have a question, what can …

linux memory malloc mmap
How to use strtok in C properly so there is no memory leak?

I am somewhat confused by what happens when you call strtok on a char pointer in C. I know that …

c malloc free strtok
When do I need dynamic memory?

Possible Duplicate: Malloc or normal array definition? We learn that there is dynamic memory in C and dynamic variables: #include &…

c memory malloc free
Is it possible to use a C++ smart pointers together with C's malloc?

Some of my code still uses malloc instead of new. The reason is because I am afraid to use new …

c++ malloc new-operator smart-pointers
Why does "The C Programming Language" book say I must cast malloc?

Today I reached page 167 of The C Programming Language (second edition Brian W. Kernighan & Dennis M. Ritchie) and found …

c casting malloc kernighan-and-ritchie
CPU and memory usage of jemalloc as compared to glibc malloc

I had recently learnt about jemalloc, it is the memory allocator used by firefox. I have tried integrating jemalloc into …

malloc cpu-usage
How to create a new char* in standard C

I have this code made for C++ (it works): char* ConcatCharToCharArray(char *Str, char Chr) { char *StrResult = new char[strlen(…

c memory malloc arrays strlen