Xref: utzoo comp.sys.ibm.pc:28682 comp.lang.c:18629 Path: utzoo!attcan!uunet!seismo!sundc!pitstop!male!sun-barr!apple!rutgers!tut.cis.ohio-state.edu!ucbvax!humus.Huji.AC.IL!yogi From: yogi@humus.Huji.AC.IL (Yossi Gil) Newsgroups: comp.sys.ibm.pc,comp.lang.c Subject: Re: Implementing Malloc (was Extended Memory without dereference operator) Message-ID: <338@shuldig.huji.ac.il> Date: 12 May 89 08:47:25 GMT References: <1141@ptolemy.arc.nasa.gov> <1143@ptolemy.arc.nasa.gov> Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: yogi%humus.bitnet@humus.Huji.AC.IL () Organization: Hebrew University, Jerusalem Lines: 23 In article <1143@ptolemy.arc.nasa.gov> raymond@ptolemy.arc.nasa.gov.UUCP (Eric A >It appears that I can write what I want in TC using the MK_FP macro to >rewrite malloc (and perhaps free). Anyone have any source/suggestions >for doing this? K&R 2nd edition pp 185-189 have source code for malloc() and for free(). Porting this code is easy (I could do it...). > >Is there anything I should know about extended memory? > You have to be in protected mode for using it, and if you are there are alot of problems in using normal DOS/BIOS services. I think that the standard pointer approach would'nt help. It seems that the 'handle' approach for accessing data is better. The basic idea is that a handle is pointer to a pointer to data. You can access ther data by doing something like: Pointer = GetPointer(handle) Pointer[i] = ... ..... The catch is that the pointer is valid only until the next call to GetPointer() with any other handle. Programming in this style is not easy, but then the GetPointer() function can be very strong, it can adapt itself to the hardware, caching into near, far, expanded, extended, unknown memory, and even using the disk.