Logo Data Structures and Algorithms with Object-Oriented Design Patterns in C++
next up previous contents index

The Last Axiom

In this section we state the last axiom we need for our detailed model of the C++ virtual machine. This axiom addresses the time required to allocate and to free dynamically allocated storage:

Axiom  The time required to allocate a fixed amount of storage from the heap using operator new is a constant, tex2html_wrap_inline58579. This time does not include any time required for initialization of the storage. Similarly, the time required to return a fixed amount of storage to the heap using operator delete is a constant, tex2html_wrap_inline58581. This time does not include any time spent cleaning up the storage before it is returned to the heap.

By applying Axioms gif and gif, we can determine that the running time of the statement

int* ptr = new int;
is tex2html_wrap_inline58583. Similarly, the running time of
delete ptr;
is tex2html_wrap_inline58585.


next up previous contents index

Bruno Copyright © 1997 by Bruno R. Preiss, P.Eng. All rights reserved.