dynamic-memory-allocation
how does 'free/delete' work? [duplicate]
This question already has answers here: Closed 11 years ago. Possible Duplicates: How does delete work in C++?[详细]
2023-03-14 16:33 分类:问答How to schedule collection cycles for custom mark-sweep collector?
I\'ve written a simple garbage collector for a Postscript virtual machine, and I\'m having difficulty designing a decent set of rules for when to do a collection (when the free list is too short?) and[详细]
2023-03-13 13:05 分类:问答Dynamic memory allocation question (in C)
Consider following codes: #include <stdio.h> #include <malloc.h> void allocateMatrix(int **m, int l, int c)[详细]
2023-03-12 06:35 分类:问答Is there a way to distinguish between new's and new[]'s return value?
Consider this code: int *p = new int; cout << sizeof(*p); delete p; As expected the result is 4. Now, consider this other code:[详细]
2023-03-10 01:26 分类:问答memory manager that manages a pre allocated block
I\'m trying to find a memory management library for C++ that would allocate from an pre-allocated memory block i give it in order to initialise it. After i\'m done i will close the allocator (and obje[详细]
2023-03-08 18:16 分类:问答Dynamically allocate or waste memory?
I have a 2d integer array used for a tile map. The size of the map is unknown and read in from a file at runtime. currently the biggest file is 开发者_如何转开发2500 items(50x50 grid).[详细]
2023-03-07 21:32 分类:问答c++ what is "pointer = new type" as opposed to "pointer = new type []"?
In many tutorials, the first code samples about dynamic memory start along the lines of: int * pointer;[详细]
2023-03-06 22:51 分类:问答Dynamic array in Linux kernel module
I am working on a modificatio开发者_开发问答n of PKTGEN for sending packets containing sequences of the Fibonacci series. This is my very first time with kernel development, so I am not very familiar[详细]
2023-03-06 08:45 分类:问答Question about memory allocation in CUDA kernel
Hey there, I have an array with the size SIZE*sizeof(double) on my host. I allocate a device pointer of the size of the host-array and copy the array to the device. Now I pass this device array dev_po[详细]
2023-03-05 07:06 分类:问答How to detect where a block of memory was allocated?
A block of memory can be allocated statically, in the stack or in the heap. I want to know a way to detect if a pointer points to the heap. I work with Windows and Linux and it is not a problem a diff[详细]
2023-03-04 14:37 分类:问答