{"title":"A polymorphic reference counting implementation in Fortran 2003","authors":"Michael List, David Car","doi":"10.1145/2007333.2007334","DOIUrl":null,"url":null,"abstract":"This paper outlines a revised reference counting programming pattern for derived types in Fortran 2003. It extends the method described by Car [1] to work with polymorphic types (i.e. using the class keyword). This reference counting pattern reduces the possibility of memory leaks by allowing the object itself to manage allocations and deallocations. It follows the pattern found in many modern object oriented languages like Java [2,3] and Python[4,5] and the auto_ptr template class in C++ [6]. The reference counting pattern described here is being used in conjunction with the PyF95++ pre-processor [7,8] and the accompanying Standard Template Library (STL). All the containers in that project are reference counted and employ the original pattern for derived types. Some of the intricacies of working with polymorphic types in Fortran are described as the implementation is discussed.","PeriodicalId":379614,"journal":{"name":"ACM SIGPLAN Fortran Forum","volume":"58 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2011-07-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"ACM SIGPLAN Fortran Forum","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2007333.2007334","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 2
Abstract
This paper outlines a revised reference counting programming pattern for derived types in Fortran 2003. It extends the method described by Car [1] to work with polymorphic types (i.e. using the class keyword). This reference counting pattern reduces the possibility of memory leaks by allowing the object itself to manage allocations and deallocations. It follows the pattern found in many modern object oriented languages like Java [2,3] and Python[4,5] and the auto_ptr template class in C++ [6]. The reference counting pattern described here is being used in conjunction with the PyF95++ pre-processor [7,8] and the accompanying Standard Template Library (STL). All the containers in that project are reference counted and employ the original pattern for derived types. Some of the intricacies of working with polymorphic types in Fortran are described as the implementation is discussed.