Science Fair Projects Ideas - Smart pointer

All Science Fair Projects

      

Science Fair Project Encyclopedia for Schools!

  Search    Browse    Forum  Coach    Links    Editor    Help    Tell-a-Friend    Encyclopedia    Dictionary     

Science Fair Project Encyclopedia

For information on any area of science that interests you,
enter a keyword (eg. scientific method, molecule, cloud, carbohydrate etc.).
Or else, you can start by choosing any of the categories below.

Smart pointer

A smart pointer is an abstract data type that simulates a pointer while providing additional features, such as automatic garbage collection or bounds checking. These additional features are intended to reduce bugs caused by the use of pointers while retaining efficiency. Smart pointers typically keep track of the objects they point to for the purpose of memory management.

Pointer usage is a major source of bugs: the constant allocation, deallocation and referencing that must be performed by a program written using pointers makes it very likely that some memory leaks will occur.

Smart pointers try to prevent the memory leaks by making the deallocation function automatic: when the pointer to an object (or the last in a series of pointers) is destroyed, for example because it goes ouside of scope, the pointed object is destroyed too.

Several types of smart pointers exist. Some work with reference counting, others assigning ownership of the object to a single pointer. If the language supports automatic garbage collection, then this use of a smart pointer is unnecessary.

Likewise, a handle is conceptually similar to a pointer, but whereas a pointer literally contains the address of the item to which it refers, a handle may be an opaque reference or obfuscated in some other way. The advantage of a handle is often that the block to which it refers can be relocated without invalidating the handle, something that is not possible with a pointer. Handles were a popular solution to memory management in operating systems of the 1980s, such as the Mac OS and Windows, but have fallen out of favour in recent times, where increases in the amount of memory available on a machine, and improved virtual memory algorithms have made the use of the simpler pointer more attractive. Unix file descriptors may also be thought of as an early example of a handle.

Like other desktop environments, the Windows API heavily uses a handle to represent objects in the system and provide a communication pathway between the operating system and its application programs. For example, a window on the desktop is represented as a handle called HWND.

See also

Exterrnal links

09-23-2007 01:00:40
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details
Science kits, science lessons, science toys, maths toys, hobby kits, science games and books - these are some of many products that can help give your kid an edge in their science fair projects, and develop a tremendous interest in the study of science. When shopping for a science kit or other supplies, make sure that you carefully review the features and quality of the products. Compare prices by going to several online stores. Read product reviews online or refer to magazines.

Start by looking for your science kit review or science toy review. Compare prices but remember, Price $ is not everything. Quality does matter.
Science Fair Coach
What do science fair judges look out for?
ScienceHound
Science Fair Projects for students of all ages
All Science Fair Projects.com Site
All Science Fair Projects Homepage
Search | Browse | Links | From-our-Editor | Books | Help | Contact | Privacy | Disclaimer | Copyright Notice