What is the meaning of the term arena in relation to memory?

前端 未结 4 1341
感情败类
感情败类 2021-01-29 19:02

I\'m reading a book on memory as a programming concept. In one of the later chapters, the author makes heavy use of the word arena, but never defines it. I\'ve

4条回答
  •  無奈伤痛
    2021-01-29 20:01

    I'll go with this one as a possible answer.

    •Memory Arena (also known as break space)--the area where dynamic runtime memory is stored. The memory arena consists of the heap and unused memory. The heap is where all user-allocated memory is located. The heap grows up from a lower memory address to a higher memory address.

    I'll add Wikipedia's synonyms: region, zone, arena, area, or memory context.

    Basically it's memory you get from the OS, and divvy out, then can be freed all at once. The advantage to this is that repeated small calls to malloc() could be costly (Every memory allocation has a performance cost: the time it takes to allocate the memory in your program’s logical address space and the time it takes to assign that address space to physical memory) where as if you know a ball park you can get yourself a big chunk of memory then hand it out to your variables as/how you need it.

提交回复
热议问题