3 ms·
Minor nitpick: there is no allocation going on here - you’re simply reserving a fixed-size buffer on the stack (assuming the array is local to a function).
by Cyph0n 6y ago
Minor nitpick: there is no allocation going on here - you’re simply reserving a fixed-size buffer on the stack (assuming the array is local to a function).
- quelsolaar 6y agoI would call that a stack allocation, but yes they are slightly different. In my mind its a feature that arrays allocated on the stack and heap can interchangeably be given as an argument to a function.
- jstimpfle 6y agoTo allocate means to get or reserve something (for lack of an even better word, as a non-native). This is a perfectly valid use of allocation. What you mean is maybe more aptly named "dynamic (memory) allocation".