There is a c++ code shown below:
Chunk * _chunk = new (size) Chunk(size);
I don't understand the first '(size)' following the 'new',What's the meaning of it? The code above is from JDK8.
There is a c++ code shown below:
Chunk * _chunk = new (size) Chunk(size);
I don't understand the first '(size)' following the 'new',What's the meaning of it? The code above is from JDK8.
That is called placement new syntax. You might be able to find more about it using the technical name. The arguments you ask about are passed to an overloaded operator new
in addition to the normal computed size in bytes.