How might I overload the “new” operator to allocate memory from a secondary memory device?

后端 未结 2 1259
我在风中等你
我在风中等你 2020-12-17 06:11

I am looking for a syntax to allocate memory from a secondary memory device and not from the default heap.

How can i implement it? Using malloc() would

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-17 06:53

    You'd have to build or adapt your own heap manager, and overload new and delete, as well as new[] and delete[]. Initialize the heap manager with the special memory.

提交回复
热议问题