Tag: malloc

2137 Do I cast the result of malloc? 2009-03-03T10:13:02.940

670 Difference between malloc and calloc? 2009-10-08T15:04:33.983

455 What REALLY happens when you don't free after malloc? 2009-03-17T15:29:09.207

400 In what cases do I use malloc vs new? 2008-10-08T19:47:55.090

337 Why is the use of alloca() not considered good practice? 2009-06-19T16:24:16.517

247 How do malloc() and free() work? 2009-07-13T12:22:18.890

225 Why malloc+memset is slower than calloc? 2010-04-22T05:40:25.080

150 Why does the Book say I must cast malloc? 2015-09-18T12:36:32.317

133 Setting variable to NULL after free 2009-06-22T05:35:16.893

132 Incompatible implicit declaration of built-in function ‘malloc’ 2011-08-13T13:49:27.657

121 What is a Memory Heap? 2010-02-22T04:15:11.570

108 Malloc vs new -- different padding 2012-11-08T10:01:56.607

108 Freaky way of allocating two-dimensional array? 2016-04-22T12:43:55.807

106 Why do I get a warning every time I use malloc? 2009-08-04T23:15:41.560

103 what's the point in malloc(0)? 2010-01-07T17:43:14.017

99 How is malloc() implemented internally? 2010-08-13T17:35:29.860

81 Why does `free` in C not take the number of bytes to be freed? 2014-06-13T11:10:25.513

78 How to find the cause of a malloc "double free" error? 2009-06-09T16:49:50.400

74 Why does malloc initialize the values to 0 in gcc? 2011-11-06T19:05:59.953

65 How can I get the size of an array from a pointer in C? 2008-10-24T07:01:43.477

65 Is malloc thread-safe? 2009-05-13T02:17:42.267

64 Using malloc for allocation of multi-dimensional arrays with different row lengths 2009-12-28T17:58:58.587

64 Free memory allocated in a different function? 2012-06-17T12:11:30.860

63 Why do I get a C malloc assertion failure? 2010-06-07T05:15:47.860

61 What happens to memory after '\0' in a C string? 2012-04-16T08:25:02.187

60 Does malloc lazily create the backing pages for an allocation on Linux (and other platforms)? 2009-05-26T17:40:49.363

58 Xcode Guard Malloc and on Device Debugging: 'libgmalloc.dylib' image not found 2012-11-15T11:47:00.090

57 Difference between array type and array allocated with malloc 2012-05-13T21:52:13.360

56 C Programming: malloc() inside another function 2010-05-14T22:29:04.533

54 How do free and malloc work in C? 2009-12-24T06:49:06.013

52 what does malloc(0) return? 2010-01-25T12:47:03.377

52 In C, how would I choose whether to return a struct or a pointer to a struct? 2016-10-21T02:45:52.840

51 Will malloc implementations return free-ed memory back to the system? 2010-02-06T23:58:11.907

51 C API design: Who should allocate? 2010-07-21T04:23:21.390

50 What is the difference between "new" and "malloc" and "calloc" in C++? 2009-04-30T16:47:59.060

49 what're the differences between tcmalloc/jemalloc and memory pool 2012-03-26T03:08:35.037

49 Why does the speed of memcpy() drop dramatically every 4KB? 2014-01-10T08:03:15.180

48 malloc() vs. HeapAlloc() 2011-11-22T09:14:23.593

48 Is there a way to mark a chunk of allocated memory readonly? 2013-02-18T07:39:08.720

47 How does malloc work in a multithreaded environment? 2012-05-22T16:50:08.190

45 invalid conversion from `void*' to `char*' when using malloc? 2011-02-24T02:20:21.287

45 Is it well-defined to use a pointer pointing to one-past-malloc? 2017-12-20T07:03:28.143

44 How does jemalloc work? What are the benefits? 2009-10-26T13:17:20.677

43 Memory Allocation/Deallocation Bottleneck? 2009-01-22T20:32:06.900

43 If `malloc(0)` returns a non-null pointer, can I pass that to `free`? 2017-06-02T14:24:43.647

42 zero size malloc 2009-07-02T08:27:40.610

42 If free() knows the length of my array, why can't I ask for it in my own code? 2010-04-16T05:49:03.160

42 When and why to use malloc? 2012-01-10T08:40:07.723

41 Can you allocate a very large single chunk of memory ( > 4GB ) in c or c++? 2008-10-08T01:18:48.463

41 How to dynamically allocate memory space for a string and get that string from user? 2011-11-17T08:18:38.943

40 Why is it safer to use sizeof(*pointer) in malloc 2013-06-23T07:42:30.247

39 Is it better to allocate memory in the power of two? 2010-07-06T20:53:52.947

39 C - freeing structs 2012-11-27T18:36:38.423

38 maximum memory which malloc can allocate 2010-05-09T16:31:46.693

37 Time complexity of memory allocation 2008-11-12T03:27:08.460

37 Why does C++ require a cast for malloc() but C doesn't? 2010-08-13T14:22:06.520

37 malloc & placement new vs. new 2012-01-22T07:16:00.430

36 C: Correctly freeing memory of a multi-dimensional array 2009-11-14T10:15:30.777

36 What does the first "c" stand for in "calloc"? 2015-08-08T00:33:01.267

35 Multithreaded Memory Allocators for C/C++ 2008-09-29T02:13:02.817

35 Create a wrapper function for malloc and free in C 2008-11-04T16:50:08.530

34 malloc vs mmap in C 2009-11-15T23:35:40.783

34 Use of cudamalloc(). Why the double pointer? 2011-11-03T00:37:24.380

34 difference between <stdlib.h> and <malloc.h> 2012-10-19T11:29:17.943

33 Does malloc() allocate a contiguous block of memory? 2009-03-09T07:16:13.890

33 When to use malloc for char pointers 2009-11-24T08:28:41.660

33 sprintf() with automatic memory allocation? 2010-09-22T23:35:56.117

32 aligned malloc() in GCC? 2010-10-01T14:08:29.457

32 LinkedList - How to free the memory allocated using malloc 2011-08-11T11:50:23.360

31 C - calloc() v. malloc() 2010-08-10T12:45:43.417

31 Overriding 'malloc' using the LD_PRELOAD mechanism 2011-05-21T16:03:14.553

30 How to use realloc in a function in C 2012-12-06T16:42:02.453

28 How can I allocate memory and return it (via a pointer-parameter) to the calling function? 2009-09-09T08:28:01.103

28 Allocating memory for a Structure in C 2010-02-01T14:38:17.580

28 How do I free memory in C? 2012-01-30T18:58:47.843

28 Explain this implementation of malloc from the K&R book 2012-10-31T08:45:47.787

28 malloc: *** error: incorrect checksum for freed object - object was probably modified after being freed 2013-11-07T16:02:29.347

27 Minimizing the amount of malloc() calls improves performance? 2010-01-16T22:35:50.660

27 Specifically, how does fork() handle dynamically allocated memory from malloc() in Linux? 2011-01-04T20:06:14.713

27 there is no heap in c? 2012-08-21T16:17:26.860

27 Dynamic array in C — Is my understanding of malloc and realloc correct? 2012-10-01T15:06:43.880

26 Have you ever obtained a significant speedup by using boost::pool? 2009-01-23T14:16:22.417

26 How big can a malloc be in C? 2010-08-11T22:01:21.637

26 malloc implementation? 2011-03-24T16:04:48.003

26 Dynamically create an array of strings with malloc 2011-05-09T11:00:25.390

26 malloc behaviour on an embedded system 2014-03-15T10:46:33.800

25 How does Intel TBB's scalable_allocator work? 2009-03-18T10:58:35.397

25 Is there a need to check for NULL after allocating memory, when kernel uses overcommit memory 2010-02-12T01:09:02.957

25 Is malloc deterministic? 2011-11-17T16:48:23.960

25 Under what circumstances can malloc return NULL? 2012-02-01T19:01:17.563

25 Behaviour of malloc with delete in C++ 2012-06-01T16:38:15.110

24 I'm very confused about malloc() and calloc() on C 2010-11-21T12:50:25.483

24 In multithreaded C/C++, does malloc/new lock the heap when allocating memory 2010-12-24T05:33:50.877

24 Heap allocate a 2D array (not array of pointers) 2012-04-12T01:47:31.997

24 How do I correctly set up, access, and free a multidimensional array in C? 2012-09-17T15:37:19.610

24 Trying to use free() to understand how it works 2014-04-14T05:19:45.187

24 Malloc vs New for Primitives 2017-06-16T11:37:36.420

23 Windows malloc replacement (e.g., tcmalloc) and dynamic crt linking 2009-05-13T15:15:45.283

23 Segfaults in malloc() and malloc_consolidate() 2010-06-23T08:50:12.993