home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / mswindo / programm / misc / 5354 < prev    next >
Encoding:
Text File  |  1993-01-25  |  2.3 KB  |  52 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!gatech!darwin.sura.net!zaphod.mps.ohio-state.edu!caen!batcomputer!cornell!newsstand.cit.cornell.edu!empire.cce.cornell.edu!avinogra
  3. From: avinogra@empire.cce.cornell.edu (Alex Vinogradov)
  4. Subject: Re: Memory management from Unix to Windows
  5. Message-ID: <1993Jan25.210311.4235@empire.cce.cornell.edu>
  6. Organization: Cornell Cooperative Extension
  7. X-Newsreader: TIN [version 1.1 PL8]
  8. References: <1993Jan23.041218.13593@netcom.com>
  9. Date: Mon, 25 Jan 1993 21:03:11 GMT
  10. Lines: 40
  11.  
  12. Michael Brill (yikes@netcom.com) wrote:
  13.  
  14. : I'm developing an app on the NeXT that I'd like to take the bulk
  15. : of to either Windows and/or Macintosh.  I think I know how to 
  16. : port everything but the UI and memory management.  Note that the
  17. : pieces of the app I want to port are just plain old ANSI C.
  18.  
  19. : As far as the UI goes, I'm not going to worry about now.  What I
  20. : am worried about is memory management.  I've scanned through the
  21. : Windows docs and understand how memory management works there
  22. : (getting handle, locking, operating, unlocking) and I'm looking
  23. : for an established scheme to make the port seamless between Unix
  24. : and Windows/Mac.
  25.  
  26. I was doing almost the same thing for the last couple of month --
  27. transferring apps from X Windows to MS Windows.  The first 90% of
  28. the time where spent trying to write my own memory-manager which
  29. would allow me to use plain malloc()/free() from the UNIX code.
  30. Only recently I found out that if I use MS C/C++ 7.0, Windows 3.1
  31. and large memory model, I can just go ahead and use malloc() and
  32. free() without having to worry about all that handles stuff. 
  33. Moreover, using malloc/free under C 7/Win 3.1/Large memory model
  34. is even better than using GlobalLock/Alloc/Unlock/Free calls
  35. because malloc/free do their own memory management.
  36.  
  37. The summary of all that is that if you not targetting for real-mode
  38. and if you are using MS C &, you do not have to worry about memory-
  39. management AT ALL !!
  40.  
  41. The only question I have is why Microsoft does not tell about it
  42. in any of the manuals that are shipped with SDK 3.1/MS C 7.0 ?
  43. (Even though when I asked a Microsoft customer support person,
  44. he confirmed that all of the above is true)
  45.  
  46.  
  47. -- 
  48. ---------------------------------------------------------
  49. Alex Vinogradov
  50. Cornell Cooperative Extension, Electronic Technology Group
  51. avinogra@empire.cce.cornell.edu
  52.