Re: Bug in MFC CList?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Dani wrote:
But can you tell me, if I'm allocating the way you are suggesting,
how much does it cost me "behind the scenes"?
I mean, in assembly code.
I normally use malloc()/free() or new/delete, knowing that it is the less expensive way. I do not like the managed code very much, because usually my applications are of the type which have to do a lot of work in the shortest time....

Dani:

As Doug suggests, you need not use new[] at all. Do like this:

CList<int> listNotBuggy[5];
char charNotBuggy[20];

It is never necessary to use new[] for local variables if you have fixed sizes. If you need run-time sizes, you should use std::vector.

--
David Wilkinson
Visual C++ MVP
.



Relevant Pages

  • Re: determining return address of a function
    ... Enrique Perez-Terron wrote: ... > The assembly code of the call of test1may possibly contain some register ... > shuffling and stack operations after the call. ... what are the possible uses of knowing the return ...
    (comp.os.linux.development.system)
  • Re: Call DLL without knowing arguments
    ... the C++ name mangling. ... knowing ahead of time, what the parameters are supposed to be. ... How can I call a DLL function filling in the arguments by code? ... The only solution I found so far is to use assembly code. ...
    (microsoft.public.windowsce.embedded.vc)