home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / mswindo / programm / tools / 1740 < prev    next >
Encoding:
Internet Message Format  |  1992-12-17  |  2.0 KB

  1. Path: sparky!uunet!lax.pe-nelson.com!lax!twbrown
  2. From: twbrown@PE-Nelson.COM (Tom W. Brown)
  3. Newsgroups: comp.os.ms-windows.programmer.tools
  4. Subject: Re: How to implement a Linked List
  5. Message-ID: <720@lax.lax.pe-nelson.com>
  6. Date: 17 Dec 92 17:18:44 GMT
  7. References: <1992Dec16.062628.3410@nuscc.nus.sg> <724532588snz@chrism.demon.co.uk> <1992Dec17.084558.9832@nuscc.nus.sg>
  8. Sender: news@lax.pe-nelson.com
  9. Organization: PE-Nelson
  10. Lines: 30
  11.  
  12. In article <1992Dec17.084558.9832@nuscc.nus.sg>, shah@cherry.NoSubdomain.NoDomain (Shahrin Abdullah) writes:
  13. |> In article <724532588snz@chrism.demon.co.uk>, chris@chrism.demon.co.uk (Chris Marriott) writes:
  14. |> |> 
  15. |> |> If you're using Microsoft C7, you can implement a linked list in Windows
  16. |> |> in exactly the same way you would for DOS - just use the standard run time
  17. |> |> library "malloc" function.  If you use the large memory model (and there's
  18. |> |> no reason not to, any more), "malloc" gets mapped onto calls to a pretty
  19. |> |> good "sub-allocator".
  20. |> |> 
  21. |>  
  22. |> The problem here is that malloc will map the memory allocation to the local
  23. |> heap. Thus if the node dynamically grow too large the local heap won't be
  24. |> able to handle that. So the question remain - how do U implement a linear 
  25. |> linked list using the Global Heap? Thanks Chris.
  26. |> 
  27.  
  28. I can't adequately speak for Microsoft C7, but I know Borland 3.1 uses a
  29. sub-segment allocator with globally allocated memory if you compile in
  30. large model.  I'd be very suprised if C7 did any different.  Note that
  31. Chris specified large model in his reply -- this is definitely the key.
  32.  
  33. However, if I'm wrong and C7 still uses the local heap for large model
  34. memory allocation then perhaps you should switch compilers :-)
  35.  
  36.  
  37. ----------------------------------------------------------------------------
  38. Tom Brown               |  "She turned me into a newt...
  39. PE Nelson Systems       |                                  ... I got better"
  40. twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
  41. ----------------------------------------------------------------------------
  42.