Object framework for automatic introduction of diagnostic information and for controlling locality of related objects
Original Publication Date: 2000-Apr-01
Included in the Prior Art Database: 2003-Jun-18
Disclosed is a object-oriented framework for the automatic introduction of diagnostic information and automatic grouping of logically related objects in continguous storage. While diagnosing problems, diagnostic information is needed in order to pinpoint problems to a subcomponent or module level; however, instrumenting diagnostic information can be a tedious task therefore it is desirable to automate and verify the insertion of diagnostic data. A related aspect of diagnosing problems is allowing subcomponents to group related objects together or near each other in storage. This has the added advantage of combining related objects for good locality of reference (e.g., caching). While the following description uses C++ terminology and techniques, the invention is applicable in object-oriented systems that allow for either application or runtime management of storage and support implementation inheritance. For description purposes, the framework introduces the InfrastructureStorageAllocator, DiagnosticRasPlaceable and DiagnosticRasIdentifiable classes. The InfrastructureStorageAllocator class knows how to allocate blocks of storage and write information in a block's header. Header information at a minimum must contain either implicitly or explicitly a logical identifier, the block size and remaining storage in the block. Additional information could be an eyecatcher, product and component ids, and creation timestamp. If there is a potential for an association of objects to logically span more than one block, a block header might also contain a pointer to the "next" associated block and a pointer to the "previous" block. The DiagnosticRasPlaceable class provides a placement new form of the operator new that allows instances to be 'laid out' in memory. The operator new method contains logic to determine from information in the block header where the object instance plus any supplemental information would fit in the block. If there is insufficient storage in the block, a mechanism for obtaining additional storage is invoked. The operator new method returns a pointer to the object instance.