Help with a c++ statement

前端 未结 2 1492
没有蜡笔的小新
没有蜡笔的小新 2020-12-11 09:05

The following statement is from WebKit. I am not 100% sure what it means. Any clues?

new ((void*)&nullAtom) AtomicString;
相关标签:
2条回答
  • 2020-12-11 09:34

    It's a placement-new. It means that the AtomicString object will be constructed at the memory location pointed to inside the parentheses (&nullAtom), rather than the usual behavior (constructed on top of a bit of memory taken off of the heap).

    0 讨论(0)
  • 2020-12-11 09:50

    That's a "placement new".

    0 讨论(0)
提交回复
热议问题