Skip to main content Accessibility help
Internet Explorer 11 is being discontinued by Microsoft in August 2021. If you have difficulties viewing the site on Internet Explorer 11 we recommend using a different browser such as Microsoft Edge, Google Chrome, Apple Safari or Mozilla Firefox.

Update 22/08/2024: Due to technical disruption, we are experiencing some delays to publication. We are working to restore services and apologise for the inconvenience. For further updates please visit our website

Home
> Automatic memory management

Chapter 4: Automatic memory management

Chapter 4: Automatic memory management

pp. 256-299

Authors

, Tufts University, Massachusetts
Resources available Unlock the full potential of this textbook with additional resources. There are free resources and Instructor restricted resources available for this textbook. Explore resources
  • Add bookmark
  • Cite
  • Share

Summary

A running μScheme program continually allocates fresh locations. How are they supplied? Memory is limited, and malloc will eventually run out. Memory can be recovered using free, but if a programmer must call free, as in C and C++, they risk memory errors: leaks, locations that are freed multiple times, and misuse of freed locations (so-called dangling-pointer errors). Memory errors can make a program crash—or, worse, silently produce wrong answers. But in languages like μScheme, full Scheme, Java, and JavaScript, which are memory-safe, such errors are impossible. The errors are prevented because the implementation of μScheme, not the μScheme programmer, figures out when it is safe to reuse a location. The techniques used to reuse locations safely are demonstrated in this chapter.

About the book

Access options

Review the options below to login to check your access.

Purchase options

eTextbook
US$84.99
Hardback
US$84.99

Have an access code?

To redeem an access code, please log in with your personal login.

If you believe you should have access to this content, please contact your institutional librarian or consult our FAQ page for further information about accessing our content.

Also available to purchase from these educational ebook suppliers