recursion using only heap area

前端 未结 6 1808
你的背包
你的背包 2021-02-10 08:51

Are there examples of recursion using only heap area?

6条回答
  •  南方客
    南方客 (楼主)
    2021-02-10 09:24

    You could do something crazy like malloc a new area, turn off interrupts and just about everything else (not possible on many systems) and set your stack pointer to that malloc area. You are technically still playing with a stack, but that stack location is now on the heap. Not a good idea to do, but it can work on some embedded type systems where you have this level of control.

提交回复
热议问题