Re: VirtualAlloc and new



Simon Trew <ten.enagro@werts> wrote:
> [...] And since 'new' will
> generally call the constructor on whatever object is being allocated, one
> would imagine this would be slower than just allocating the raw memory.

I am not sure how you would use this advantage.
Either you need raw memory, then 'new char[K]'
will do (and won't call any ctors) or you need
initialized objects, in which case you, well,
need them initialized. Of course, you can
allocate raw memory and manually initialize
them later -- but what would that buy you?

> S.


Schobi

--
SpamTrap@xxxxxx is never read
I'm Schobi at suespammers dot org

"Coming back to where you started is not the same as never leaving"
Terry Pratchett


.



Relevant Pages

  • Re: multiple definitions....
    ... > also i think with a GNU compiler) I get no errors or warnings. ... simply because i am allocating memory for it ... When a global is allocated by more than one translation unit, the linker (or ... When both tu initialize the global, ...
    (comp.lang.c)
  • Re: initializing an array of user-defined data types
    ... After allocating it, I want to initialize it so that after ... And, of course, the usage notes to the NULLintrinsic include the following warning -- ... If you use module DFWIN or DFWINTY, you will have a name conflict if you use the NULL intrinsic. ...
    (comp.lang.fortran)
  • Re: initializing an array of user-defined data types
    ... Bart Vandewoestyne wrote: ... After allocating it, I want to initialize it so that after ... assign some pieces to board positions and leave others empty ... ...
    (comp.lang.fortran)
  • Re: initializer for array of struct
    ... > be a way to initialize each without allocating off the heap. ... Well, if it weren't in an array, it still wouldn't be allocating on the ...
    (microsoft.public.dotnet.languages.csharp)
  • initializing an array of user-defined data types
    ... I have a rank 2 array of a user-defined type as follows: ... After allocating it, I want to initialize it so that after ... assign some pieces to board positions and leave others empty ... ...
    (comp.lang.fortran)