|
From: Per W. <pw...@ia...> - 2003-07-15 18:31:44
|
The void* parameter of delete is only guaranteed in linear addressing mode. For 16-bit segmented code, delete might take a couple of other parameter types, depending on memory model used. It might take void __near* and void __far *. The void __far * is for 16-bit Intel composed of a 16:16 bit pointer, where the first 16 bit are the segment, and the next 16 bit are offset. However, a 16:16 pointer is still treated as a single parameter in the code, i.e. you still write "delete myobj;", where myobj contains a pointer returned by new. It is just code performing advanced pointer manipulation that needs to know that the pointer is segmented. For memory areas < 64kB this isn't a problem since the offset part spans 64kB. Arrays and memory blocks larger than 64kB do require special treatment, such as conversion to void __huge * to make sure that the offset part is always normalized 0..15 and the segment is constantly adjusted too. /Per W On Tue, 15 Jul 2003, Hossein Haeri wrote: > Dear Daniel, > > > What parameters does delete take? I'm being told by the compiler the first > > is __segment and the second is a __based(void)* ????? > > Is this right? > > If you only want the arguments, the following (the full signature) will > convince you: > > void* operator delete(void*) throw(); > void* operator delete [] (void*) throw(); > > I cite them directly from the Standard draft. But if you need more > information take a look to Section 3.7.3.2 (Deallocation functions) in > Standard. I don't have Accrobat Distiller. If I had I would send you > the wholl chapter as a pdf file. > > You will also find good stuff in TC++PL:Spec. E.g., consider Section > 6.2.6.2, Section 15.6.1, and (the best at) Section 19.4.5. > > Regards, > --Hossein > > > -- > __________________________________________________________ > Sign-up for your own FREE Personalized E-mail at Mail.com > http://www.mail.com/?sr=signup > > CareerBuilder.com has over 400,000 jobs. Be smarter about your job search > http://corp.mail.com/careers > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Parasoft > Error proof Web apps, automate testing & more. > Download & eval WebKing and get a free book. > www.parasoft.com/bulletproofapps1 > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |