NNTP-Posting-Date: Wed, 07 Nov 2012 07:31:30 -0600 From: Chris Hinsley Newsgroups: comp.lang.forth Date: Wed, 7 Nov 2012 13:31:30 +0000 Message-ID: <201211071331303144-chrishinsley@gmailcom> References: <2012110713104285278-chrishinsley@gmailcom> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [OT] Buddy System Memory Allocator User-Agent: Unison/2.1.9 Lines: 35 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-mGr0a0eydV28+2gZNuGTKNzzGs4gYOl9bUAydEDYa0qLt2bd4tAy1iw89d0I4Ob5AcdvWLGlTnpkf/k!Ur70yoAWhC7HMGqOIkUDIayfpmwcFJp5CpmF8T1whsVOSsLGvG0WnWC3g9+Q8ILo2TzQMQ== X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1952 Path: csiph.com!usenet.pasdenom.info!news.stben.net!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!news.giganews.com.POSTED!not-for-mail Xref: csiph.com comp.lang.forth:17114 On 2012-11-07 13:10:42 +0000, Chris Hinsley said: > I don't have a buddy allocator, but if you want to look at my version > of a best fit, sorted by size of block allocator, based on a simple > double linked freelist have a look here: > > https://sites.google.com/site/chrishinsley/ > > You want the list.f and memory.f files from the Forth.zip. > > Hope that gives you some ideas. > > Best Regards > > Chris Only words that you need from the forth.f file (beyond the standard stuff, that your Forth will have anyways) are the structure definition words, and the >FIELD word makes use of a special I did in my kernel 'ADD-IMMED,' which just compiles an immediate add. But you can do that instead as: : >FIELD \ ( s-addr 'name' -- f-addr ) ' EXECUTE ?DUP IF POSTPONE LITERAL POSTPONE + THEN ; IMMEDIATE Regards Chris