rc(ID:4746/rc:004)

Region C 


Region C

C with regions in memory


References:
  • Gay, David and Aiken, Alex "Memory management with explicit regions" pp313-323 view details
          in Proceedings of the 1998 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Montreal, Canada, June 1998 view details
  • Gay, David and Aiken, Alex "Language support for regions" pp70?80 view details
          in SIGPLAN Notices 36(05) May 2001 Proceedings of the 2001 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Snowbird, Utah, June 2001. view details
  • Berger, Emery D.; Zorn, Benjamin G.; and McKinley, Kathryn S. "Reconsidering Custom Memory Allocation" OOPSLA?02, November 48, 2002, Seattle, Washington, USA. view details Abstract: Programmers hoping to achieve performance improvements often use custom memory allocators. This in-depth study examines eight applications that use custom allocators. Surprisingly, for six of these applications, a state-of-the-art general-purpose allocator (the Lea allocator) performs as well as or better than the custom allocators. The two exceptions use regions, which deliver higher performance (improvements of up to 44%). Regions also reduce programmer burden and eliminate a source of memory leaks. However, we show that the inability of programmers to free individual objects within regions can lead to a substantial increase in memory consumption. Worse, this limitation precludes the use of regions for common programming idioms, reducing their usefulness.
    We present a generalization of general-purpose and region-based allocators that we call reaps. Reaps are a combination of regions and heaps, providing a full range of region semantics with the addition of individual object deletion. We show that our implementation of reaps provides high performance, outperforming other allocators with region-like semantics. We then use a case study to demonstrate the space advantages and software engineering benefits of reaps in practice. Our results indicate that programmers needing fast regions should use reaps, and that most programmers considering custom allocators should instead use the Lea allocator. Extract: RC
    Gay and Aiken describe safe regions which raise an error when a programmer deletes a region containing live objects and introduce the RC language, an extension to C that further reduces the overhead of safe region management. While these authors present only the benefits of regions, we investigate the hidden memory consumption cost and
    limitations of regions and present an alternative that avoids these
    drawbacks and combines individual object deletion with the benefits
    of regions.
          in SIGPLAN Notices 36(05) May 2001 Proceedings of the 2001 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Snowbird, Utah, June 2001. view details