Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: Buddy System Memory Allocator Date: Wed, 7 Nov 2012 19:44:17 -0500 Organization: Aioe.org NNTP Server Lines: 24 Message-ID: References: <1b12d69b-ae6e-4a1a-821a-1badbb0100ed@k6g2000vbr.googlegroups.com> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.2001 X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Microsoft Outlook Express 6.00.2800.2001 X-Priority: 3 X-MSMail-Priority: Normal Xref: csiph.com comp.lang.forth:17130 "Mark Wills" wrote in message news:1b12d69b-ae6e-4a1a-821a-1badbb0100ed@k6g2000vbr.googlegroups.com... ... > I've yet to study dynamic memory allocation in any detail, as in my > assembler and C days we relied on static allocation (which worked > perfectly) and in my later higher-level language (VB and .Net) it was > handled automagically. It's a very interesting subject. > It's "automagically" done for you in C too. In C, it's hidden behind C functions. At some point, these call the host OS' memory allocator. E.g., malloc() and free() are the easiest C functions to notice. But, the file I/O functions also use the host OS' memory allocator too. Technically, they allocate and free file storage space, but the file I/O is usually buffered in memory. Some functions, like tmpfile(), are commonly implemented in memory only. So, you can use file I/O functions to do "memory" allocation in C. From the programming perspective with C, it doesn't really matter if the data is in a file or memory. Rod Pemberton