home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / mswindo / programm / tools / 1734 < prev    next >
Encoding:
Text File  |  1992-12-17  |  1.8 KB  |  44 lines

  1. Newsgroups: comp.os.ms-windows.programmer.tools
  2. Path: sparky!uunet!spool.mu.edu!yale.edu!jvnc.net!newsserver.technet.sg!nuscc!cherry!shah
  3. From: shah@cherry.NoSubdomain.NoDomain (Shahrin Abdullah)
  4. Subject: Re: How to implement a Linked List 
  5. Message-ID: <1992Dec17.084558.9832@nuscc.nus.sg>
  6. Sender: shah@cherry (Shahrin Abdullah)
  7. Organization: Institute of Systems Science, NUS, Singapore
  8. References: <1992Dec16.062628.3410@nuscc.nus.sg> <724532588snz@chrism.demon.co.uk>
  9. Date: Thu, 17 Dec 1992 08:45:58 GMT
  10. Lines: 32
  11.  
  12. In article <724532588snz@chrism.demon.co.uk>, chris@chrism.demon.co.uk (Chris Marriott) writes:
  13. |> In article <1992Dec16.062628.3410@nuscc.nus.sg> shah@cherry.NoSubdomain.NoDomain writes:
  14. |> 
  15. |> >Hi there!
  16. |> >Does anyone out there knows how to implement a linked list for Windows using
  17. |> >MS C7. I know how to do it in C but in Windows it look tricky. I think I may
  18. |> >need to use the global heap with the GMEM_MOVEABLE flag but I not too sure
  19. |> >of going around  doing it. Can anyone gave me some pointer, please. Any 
  20. |> >source code sample is also appreciated. 
  21. |> >
  22. |> >Shahrin 
  23. |> >E-mail shah@iss.nus.sg
  24. |> >
  25. |> 
  26. |> If you're using Microsoft C7, you can implement a linked list in Windows
  27. |> in exactly the same way you would for DOS - just use the standard run time
  28. |> library "malloc" function.  If you use the large memory model (and there's
  29. |> no reason not to, any more), "malloc" gets mapped onto calls to a pretty
  30. |> good "sub-allocator".
  31. |> 
  32. |> Chris
  33. |> -- 
  34.  
  35. The problem here is that malloc will map the memory allocation to the local
  36. heap. Thus if the node dynamically grow too large the local heap won't be
  37. able to handle that. So the question remain - how do U implement a linear 
  38. linked list using the Global Heap? Thanks Chris.
  39.  
  40. Cheers!
  41.         Shahrin
  42.         E-mail shah@iss.nus.sg
  43.  
  44.