Skip to main content

Automatic Persistence for Objective-C

  • Chapter
  • First Online:
  • 759 Accesses

Abstract

This chapter describes the implementation details of the QSP persistence. It starts with a single page from which all the objects are allocated. When more space is needed, additional pages are automatically allocated. When storing data to disk, all data are collapsed into a single page, and the unused objects are eliminated. During each program run a temporary management of free objects is used.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD   54.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    These counts exclude blank lines and comments.

  2. 2.

    This requirement is specific for Objective-C; it would not be required in the C++ implementation.

  3. 3.

    This should be avoided because ARC does not work with struct that hides a pointer.

  4. 4.

    This is an addition to the standard Objective-C, which has no mechanism for this. The established way of doing this is to use class NSArray.

  5. 5.

    The line with prtList may be eventually removed, assuming the automatic pointer detection proves reliable and covering all possible situations.

  6. 6.

    For another interesting example, see bk\chap6\testinit.m.

  7. 7.

    One million books, without abstracts, five runs for each coding style.

  8. 8.

    This is our allocation scheme, not a part of standard Objective-C.

  9. 9.

    As QSP does.

  10. 10.

    For a running example see directory bk\chap6\autoPtrs

  11. 11.

    With this arrangement, ptrList may provide only some pointers, or no pointers if no struct is used.

  12. 12.

    See Sect. 6.1.

  13. 13.

    At the moment we believe that pointers embedded in a struct are the only situation not covered.

  14. 14.

    It does not matter where the call is, it only matters what it allocates.

  15. 15.

    http://stackoverflow.com/questions/7376261/are-nsstrings-stored-on-the-heap-or-on-the-stack-and-what-is-a-good-way-to-initi

  16. 16.

    http://developer.apple.com/library/ios/#documentation/general/conceptual/CocoaEncyclopedia/ClassClusters/ClassClusters.html

  17. 17.

    For a running example, see directory bk/chap6/possible

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jiri Soukup .

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Soukup, J., Lokanath, R., Soukup, M. (2014). Automatic Persistence for Objective-C. In: Serialization and Persistent Objects. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-39323-5_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-39323-5_6

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-39322-8

  • Online ISBN: 978-3-642-39323-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics