🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #41

How do C++ operators new and delete work in Windows?

#41
From: atif
Date: Wed, 28 Oct 1992 09:51
24 lines
1482 bytes
Does any body know which Windows memory management do C++ operators
'new' and 'delete' use? For example, if I do the following in a C++
Windows program:

	MyObject *pObject = new MyObject;
	
Does it mean that pObject is a global allocation or a local one. 
Does 'new' use GlobalAlloc or LocalAlloc? If so, what are the
memory flags used with GlobalAlloc or LocalAlloc. Therefore, whether
the block is allocated as fixed, moveable, discardable, zeroinit
and so forth. I would very much appreciate if anyone could give
a detailed insight into the functionality of these C++ operators
under Windows. I know that using the standard malloc yields a 
fixed local memory block. Also, are C++ operators discouraged from
use like the standard C allocation functions?

Thanks in advance.

---------------------------------------------------------------
 ATIF AZIZ         |  Infotec S.A., Geneva, SWITZERLAND.  
 Software Engineer |  "Imagination is better than knowledge."   
 atif@infotec.ch   |             - Albert Einstien. 
---------------------------------------------------------------
Technical Details
Message-ID: <1992Oct28.095117.731@infotec.ch>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!chsun!ingva!atif

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!chsun!ingva!atif
From: atif@infotec.ch
Subject: How do C++ operators new and delete work in Windows?
Message-ID: <1992Oct28.095117.731@infotec.ch>
Keywords: C++ Operators new delete memory Windows
Organization: Infotec S.A.
Distribution: comp
Date: Wed, 28 Oct 1992 09:51:17 GMT
Lines: 24