Global “placement” delete[]

后端 未结 4 1686
北恋
北恋 2021-02-06 03:19

I am trying to replace new/delete with my own allocator(s). So, overriding placement new and delete - quite happy with that. Looks something like this ...

void*          


        
4条回答
  •  北海茫月
    2021-02-06 03:52

    You could look the pointer up in your allocator, find out the size from your bookkeeping and compute the number of elements using sizeof T.

提交回复
热议问题