Talk:Memory allocation: Difference between revisions

m
added a section header to the first topic to properly place the table-of-contents (TOC) --- (this happens more often than one would think).
m (added a section header to the first topic to properly place the table-of-contents (TOC) --- (this happens more often than one would think).)
 
(2 intermediate revisions by 2 users not shown)
Line 1:
== languages like C ... ==
About langs like C, the task requires explanation about the fact that local variables are "allocated" on the stack (likely), so that a way of "allocating" 100 integers is simply <code>int ints[100]</code> ... even though this is not an ''explicit allocation''? --[[User:ShinTakezou|ShinTakezou]] 16:51, 26 May 2009 (UTC)
: Yes, please do explain the difference in lifetime and syntax of "auto" vs. malloc() allocations. --[[User:IanOsgood|IanOsgood]] 16:53, 26 May 2009 (UTC)
Line 7 ⟶ 8:
I think this task does not apply to [[Tcl]], and suspect it is not applicable to any other dynamic language either. They all leave memory management to their runtime; that's part of their charm. But I won't help them by marking tasks with <nowiki>{{Omit}}</nowiki> for them... —[[User:Dkf|Dkf]] 19:11, 26 May 2009 (UTC)
: I was hoping that even dynamic languages could show how to how to manage lifetimes of blocks of memory, for use in foreign function interfaces, for example. --[[User:IanOsgood|IanOsgood]] 22:18, 26 May 2009 (UTC)
:: That tends to be handled in the FFI binding itself. I do have some ideas on how to do this, but it needs quite a bit of code. —12:54, 11 June 2009 (UTC)
 
I am not clear on what exactly counts as allocating a "block" of memory. Does it mean you have to explicitly calculate the size of the memory you are allocating? or does allocating an object count? or allocating an array?