|Número de publicación||USRE42396 E1|
|Tipo de publicación||Concesión|
|Número de solicitud||US 11/286,439|
|Fecha de publicación||24 May 2011|
|Fecha de prioridad||27 Feb 2001|
|También publicado como||US6654773, US20020120640|
|Número de publicación||11286439, 286439, US RE42396 E1, US RE42396E1, US-E1-RE42396, USRE42396 E1, USRE42396E1|
|Inventores||Theodore S. Hills|
|Cesionario original||Tangie Data Holdings Llc|
|Exportar cita||BiBTeX, EndNote, RefMan|
|Citas de patentes (20), Otras citas (3), Clasificaciones (11), Eventos legales (5)|
|Enlaces externos: USPTO, Cesión de USPTO, Espacenet|
A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.
This invention relates generally to programming of digital computers, and, more specifically, to memory management and garbage collection.
There are presently two broad approaches to memory management: (1) programmer memory management where programmers are responsible for writing explicit program code to de-allocate memory for the storage of objects no longer needed by a program; and (2) automatic memory management where the de-allocation of memory is done automatically, after the system determines that objects are no longer needed.
If memory management is automatic, there is no room left for programmer errors in memory management, which result in memory leaks, dangling pointers, or both.
A memory leak occurs when a program fails to de-allocate an object which it no longer needs. The accumulation of such unneeded objects during the execution of a program can lead to an unnecessary exhaustion of memory available for executing the program, end a resultant program abortion.
A dangling pointer reflects the converse mistake in memory management. This occurs when program code is executed which de-allocates an object while pointers to it still exist in an executing program. If some portion of code attempts to use the de-allocated object through a pointer it still possesses, the result is unpredictable and usually erroneous.
Automatic memory management removes the possibility of either of these errors. There is therefore an increase in the expectation of the reliability of a program executed with automatic memory management, over one executed with programmer-controlled explicit memory management. There is a significant labor savings in developing software for a system that supplies automatic memory management, since memory management mistakes are difficult to discover. However, automatic memory management systems do exact a toll in the efficiency of the programs using them, as is discussed below.
Many garbage collection methods have been proposed, the purpose of all of which is to discover, automatically and in as little processing time as possible, what objects in a program's memory are no longer needed by a program, so that those objects can be de-allocated and their storage reclaimed. Some of these garbage collection methods have significant processing overhead, which reduces the desirability of these methods and even precludes them from being used in certain applications (such as high-speed real-time systems). Thus, it is desirable that automatic memory management be as efficient as possible, to allow the broadest range of applicability.
Many garbage collection systems are constructed so as to suspend the normal execution of a program at random intervals, in order to find and delete objects in memory that are no longer needed. A program executed with such a garbage collection system can never be depended on to run in exactly the same manner as any prior execution, even given all of the same operating conditions and inputs. Determinism is lost.
Determinism is important for real-time applications where physical processes outside a computer controlling them are occurring at a fixed rate. The software controlling such computers must be able to guarantee that it will respond to external events within known time limits. Under such circumstances, the use of a non-deterministic garbage collection mechanism may be precluded.
One approach to garbage collection uses reference counting. In this method, each object has a property attached to it called its reference count, which is merely the number of objects that possess a pointer to that object. Clearly, when an object's reference count becomes zero, it may safely be de-allocated.
It is fairly simple and somewhat efficient to manage a reference count for an object, but the method has a significant limitation involving circular references. Suppose a program allocates objects A and B, stores a reference to A in B, and stores a reference to B in A. Now, even if all other references to the objects A and B are deallocated, A and B would each have a reference count of 1, indicating their references to each other. Thus, A and B would never be de-allocated, and this represents a memory leak.
The above-discussed and other drawbacks and deficiencies of the prior art are overcome or alleviated by a garbage collection method of the present invention. The garbage collection method distinguishes between local objects and managed objects, and between an ordinary pointer to an object, an owning pointer to an object, and a non-owning pointer to an object. Ordinary pointers may point only to local objects, and owning and non-owning pointers may point only to managed objects. Managed objects have attributes including a count of the number of owning pointers referring to them, and a linked list of non-owning pointers referring to them. Managed objects may only possess non-owning pointers. Only an invocation of a subroutine within a thread can possess an owning pointer. Using this method, when an invocation exits, its exit code gives up ownership of all objects it owned. When an object is no longer reachable from any owning pointer, either directly, or indirectly through non-owning pointers, the object is immediately deallocated.
By implementing data structures and methods to support owning pointers, non-owning pointers, and managed objects, and by enforcing rules regarding the use of ordinary pointers, owning pointers, and non-owning pointers, efficient and deterministic garbage collection is achieved, memory leaks and dangling pointers are eliminated, and objects containing circular references to each other are not a source of memory leaks.
The present invention is embodied in software preferably written using an object-oriented programming language. It is also embodied in multi-threaded environments, multi-process environments, and as part of a persistence management system. It is embodied as an intrinsic part of a programming language. It may also be used to access POSIX®-compliant file systems.
The garbage collection method of the present invention has the following and other advantages over prior art garbage collection methods, some of which are essential for real-time applications. It is deterministic. A given graph of managed objects, owning pointers, and non-owning pointers will always be destroyed at the same point in a program, on every run of that program under the same conditions. Given these characteristics, a program never will be pre-empted randomly while a garbage collector cleans up memory. The cost of memory management, and the timing of its execution, can always be directly derived from the program. It de-allocates as early as possible, so total memory consumption is always the minimum possible. Destruction is guaranteed before termination of the program. In an object-oriented implementation, destruction will call an object's destructor to release any resources in use by the object, which may include resources other than memory. An object-oriented programming system incorporating the present invention can guarantee that the destructor of every object will be called as soon as the abject is no longer reachable by the program.
The above-discussed and other features and advantages of the present invention will be appreciated and understood by those skilled in the art from the following detailed description and drawings.
Referring now to the drawing wherein like elements are numbered alike in the several FIGURES:
The present invention specifies an invocation, an owning pointer, a non-owning pointer, and a managed object. In the preferred embodiment, these are modeled using statements of an object-oriented programming language as classes with the names Invocation, OwningPointer, NonOwningPointer, and ManagedObject, respectively.
An invocation is an invocation of a subroutine within a thread of a process of a system. An invocation ceases to exist when it is exited. An owning pointer is a pointer from an invocation to a managed object that establishes an ownership relationship between the invocation and the managed object. The owner of an owning pointer owns the managed object to which it points. A non-owning pointer is a pointer from an owner to a managed object that does not establish an ownership relationship between the owner and the managed object. The owner of a non-owning pointer does not own the managed object to which it points. Only owning and non-owning pointers may point to managed objects, and owning and non-owning pointers may only point to managed objects. Owning pointers may only exist as local objects in invocations, and must be destroyed when their invocations exit. Owning pointers may not exist as members of managed objects. Non-owning pointers may exist as local objects in invocations, or as members by composition of managed objects. Both owning and non-owning pointers have semantics very similar to ordinary pointers. Both can reference either exactly one object, or no objects at all when in the null state. Both can be altered to reference various objects at various times, and/or be set to the null state. Both can be de-referenced to access the referenced object.
Ownership is a relationship between an object and an owner that governs the lifetime of the object, where the object may not be destroyed except by its sole or final owner, and may not outlive its sole or final owner. An owner is an invocation or a managed object that owns other objects. An invocation owns all of its local objects, and owns all of the managed objects referenced by owning pointers that it owns as local objects. A managed object owns all of its local objects; that is, all of the members of which it is composed. A local object is an object that is not a managed object. It is allocated in such a way that it will not outlive the invocation or managed object that created it. Ordinary pointers may only exist as local objects, and must be destroyed when their owners are destroyed. Only ordinary pointers may point to local objects, and ordinary pointers may only point to local objects. An ordinary pointer is neither an owning pointer nor a non-owning pointer.
A managed object is an object that has been allocated in such a way that the garbage collection method described herein can be applied to it. It is of interest to allocate an object as a managed object if it could potentially outlive the invocation that created it, and/or if references to it could outlive the invocation that created it. Managed objects must be allocated in such a way that they may live longer than the invocation which allocates them, but local objects may be allocated in such a way that they cannot live longer than the invocation which allocates them. For instance, in the preferred embodiment, invocations use a stack data structure for local objects, such that local objects are popped from the stack upon exit of an invocation. Managed objects may not be allocated on such a stack, but local objects may be allocated on such a stack. Alternatively, local objects may be allocated on a heap or other data structure also containing managed objects, but this does not cause local objects so allocated to become managed objects. As soon as an owner creates a managed object, an owning or non-owning pointer must reference it. Once a managed object exists, more owning and non-owning pointers may point to it. A managed object is reachable if there is at least one owning or non-owning pointer owned by and local to an invocation which can reach the object through that pointer, either directly through that pointer, or indirectly through non-owning pointers in other managed objects accessible through that pointer. The design of the garbage collection method described herein is such that a managed object will exist as long as it is reachable, and will be destroyed as soon as it is no longer reachable. When a managed object is destroyed, all non-owning pointers to it, if any, are nullified. To nullify a pointer is to set it to the null state, such that it references no objects. A pointer that is in the null state can be referred to as a null pointer. The destruction of a managed object may in turn cause other managed objects to become unreachable. This condition consequently requires that those managed objects be destroyed as well.
To destroy an object means to both finalize and de-allocate an object. Destruction is the process of destroying an object. To finalize an object means to set all of its members to a final state, in which de-allocation of the object can be done correctly, with no leaks of memory or other resources. The terms destroy and destruction are commonly used in object-oriented systems. In the present invention, certain methods must be executed immediately before the de-allocation of managed objects. In a preferred embodiment of the invention an object-oriented programming language system is employed, wherein the methods that must be executed immediately before the destruction of objects is implemented in the destructor methods of managed objects.
Referring now to
OwningPointer 102 represents an owning pointer. OwningPointer 102 has only one attribute and that is an ordinary pointer pOwned to a Managed Object 103. A method operator=( ) of OwningPointer 102 (i.e., the assignment operator) allows the value of another instance of OwningPointer 102 to be copied to the current instance of OwningPointer 102. An overloaded operator=( ) may also be defined as a member of OwningPointer 102 that allows the current instance to be set to refer to the referent of an instance of NonOwningPointer 104. The method nullify( ) of OwningPointer 102 causes the current instance of OwningPointer 102 to enter the null state, such that it ceases to reference any ManagedObject 103. Its algorithm is given in more detail below. Although not represented in
A function owned( ) of ManagedObject 103 returns true if and only if member nOwners of the current instance of ManagedObject 103 is not zero. A function reachable( ) of ManagedObject 103 returns true if either owned( ) returns true, or if the member pfirstRef of the current instance of ManagedObject 103 is not null, and at least one of NonOwningPointers 104 on the list headed by the pFirstRef has a pReferrer referencing an instance of ManagedObject 103 whose reachable( ) function returns true. The algorithm of the function reachable( ) is presented in greater detail below.
A method possess( ) is called on an instance of ManagedObject 103 by OwningPointer 102 when its value is set to refer to that instance. The method does nothing more than increases nOwners by 1. A method disown( ) is called on an instance of ManagedObject 103 by OwningPointer 102 when its value was set to refer to that instance, but is changed so that it no longer points to that instance. The method does nothing more than decreases nOwners by 1.
A method addRef( ) is called on an instance of ManagedObject 103 by NonOwningPointer 104 when its value is set to refer to that instance. The method links the instance of NonOwningPointer 104 that called it into the singly linked list headed by its attribute pfirstRef A method removeRef( ) is called on an instance of ManagedObject 103 by NonOwningPointer 104 when its value was set to refer to that instance, but is changed so that it no longer points to that instance. The method unlinks the instance of NonOwningPointer 104 that called it from the singly linked list headed by its attribute pFirstRef Although not represented in
These attributes enable a reachable( ) function to work. They also allow instances of NonOwningPointers 104 to be nullified when their referent (indicated by pReferent) is destroyed. A method operators=( ) of NonOwningPointer 104 (i.e., the assignment operator) allows the value of another instance of NonOwningPointer 104 to be copied to the current instance of NonOwningPointer 104. An over-loaded operator ( )=may also be defined as a member of NonOwningPointer 104 that allows the current instance to be set to refer to the referent of an instance of OwningPointer 102. A method nullify( ) of NonOwningPointer 104 causes the current instance of NonOwningPointer 104 to enter the null state, such that it ceases to reference any ManagedObject 103. Its algorithm is given in more detail below. Although not represented in
A singly linked list of NonOwningPointers 104, together with ManagedObjects 103 that possess these pointers by composition, form a directed graph that may contain cycles. This is the problem of circular references encountered in the prior art. In order to traverse this graph to determine whether any ManagedObject 103 is reachable from Invocation 101, each node visited must be marked, so that in following a cycle in the graph, an endless loop does not occur. To that end, a bNodeVisited Boolean attribute of ManagedObject 103 is set to true before interrogating its list of NonOwningPointers 104, and set to false upon completion. If, during a traversal of the graph, ManagedObject 104 is found with bNodeVisited true, it is treated as a non-reachable node. This will be seen in the algorithm presented below.
If the bNodeVisited member of the current instance is false, then the reachable( ) function sets it to true 206, to prevent infinite recursive calls of the reachable( ) function as just described. The reachable( ) function then sets a new local variable, an ordinary pointer pRef, to the value of the member pFirstRef of the current instance 207. From this point on, a variable pRef indicates the current node on the singly linked list whose head is pointed to by pFirstRef. If the list is empty, pRef will be null.
The reachable( ) function next tests pRef 208. If it is null, then the list is empty. The reachable( ) function sets member bNodeVisited to false 209, and returns false to a caller 210, indicating that the current instance of class ManagedObject 103 is not reachable. In this case, the instance is not reachable because it has no owners, and no other NonOwningPointers 104 refer to it.
If pRef is not null, the reachable( ) function tests pRef->pReferrer 211. If pRef->pReferrer is null, then the referrer, that is, the owner of the instance of NonOwningPointer 104 indicated by pRef, is an invocation. Since this NonOwningPointer 104 is owned by an invocation, ManagedObject 103 to which it refers by pReferent is reachable by that invocation. The reachable( ) function sets bNodeVisited to false 212, and returns true 213.
If pRef->pReferrer is not null, then the referrer is ManagedObject 103 indicated by pRef->pReferrer; that is, ManagedObject 103 that owns by composition NonOwningPointer 104 indicated by pRef. The reachable function invokes pRef>p-Referrer->reachable( ) 214. If the reachable( ) function so invoked returns true, then the reachable( ) function of the current instance sets bNodeVisited to false 212, and returns true to the caller 213, indicating that the current instance of class ManagedObject 103 is reachable. In this case, the instance is reachable, even though it has no owners, because ManagedObject 103 has been found which refers to it and which is itself reachable.
If the reachable( ) function returns false, then the reachable( ) function of the current instance sets local variable pRef to the value of pNextRef in the current node pointed to by pRef 215. After this assignment, either pRef points to the next node on the linked list, or, if the previous value of pRef pointed to the last node on the list, pRef is null. The reachable( ) function of the current instance then loops to test pRef again 208. If it is null, then the end of the list has been reached. The reachable( ) function sets member bNodeVisited to false 209, and returns false to the caller 210, indicating that the current instance of class ManagedObject 103 is not reachable. In this case, the instance is not reachable because it has no owners, and other NonOwningPointers 104 refer to it, but none of them are reachable.
If pRef is not null, the reachable( ) function of the current instance continues with the test indicated by box 211 on the flowchart, as described above. This loop terminates when either a reachable node is found or the end of the singly linked list is reached, as described above.
The nullify( ) method can be invoked on any instance of OwningPointer 102, and will cause the destruction of ManagedObject 103 to which it refers if that ManagedObject 103 becomes unreachable. Referring to
If the pOwned attribute is not null, then it refers to some instance of ManagedObject 103. The nullify( ) method invokes the disown( ) method 303 of that ManagedObject 103. It then interrogates the same instance of ManagedObject 103 indicated by pOwned, to determine whether it is still reachable 304. If ManagedObject 103 is no longer reachable, the nullify( ) method destroys it 305. Whether reachable or not, the nullify( ) method sets pOwned to null 306, and exits 307.
The nullify( ) method is invoked by other methods of OwningPointer 102 under the following conditions: upon destruction of an OwningPointer 102; and if an assignment method is called, and the ManagedObject 103 to which the OwningPointer 102 currently refers is not the same as the one to which it will refer after the assignment method completes. By this means, whenever an OwningPointer 102 ceases to point to a ManagedObject 103, that ManagedObject 103 is tested to see if it is still reachable and if it is not, that ManagedObject 103 is destroyed.
The nullify( ) method can be invoked on any instance of NonOwningPointer 104, and will cause the destruction of the ManagedObject 103 to which it refers if that ManagedObject 103 becomes unreachable. Referring to
If the pReferent attribute is not null, then it refers to some instance of ManagedObject 103. The nullify( ) method sets a new local variable, localpRef, to the value of pReferent, and sets pReferent to null 403. This prevents infinite recursive calls to nullify( ) on the same instance of NonOwningPointer 104.
The nullify( ) method then calls the removeRef( ) method 404 of ManagedObject 103 indicated by localpRef, to remove the current instance of NonOwningPointer 104 from that ManagedObject's singly linked list of referrers. It then interrogates the same instance of ManagedObject 103 indicated by localpRef, to determine whether it is in its destructor, by testing its attribute bInDestructor 405. If true, the nullify( ) method exits 408. If Managed Object 103 is in its destructor, there is no need to destroy it.
If ManagedObject 103 is not in its destructor, the nullify( ) method tests to see if it is still reachable 406. If the ManagedObject 103 is no longer reachable, the nullify( ) method destroys it 407. In either case, the nullify( ) method exits 408.
The nullify( ) method is invoked by other methods of NonOwningPointer 104 under the following conditions: upon destruction of a NonOwningPointer 104; and if an assignment method is called, and the ManagedObject 103 to which the NonOwningPointer 104 currently refers is not the same as the one to which it will refer after the assignment method completes. By this means, whenever a NonOwningPointer 104 ceases to point to a ManagedObject 103, that ManagedObject 103 is tested to see if it is still reachable and if it is not, that ManagedObject 103 is destroyed.
By virtue of an object-oriented programming system, a NonOwningPointer 104 that is a member by composition of ManagedObject 103 is only destroyed when ManagedObject 103 of which it is a member is about to be destroyed. By calling nullify( ), the destruction of NonOwningPointer 104 may cause other ManagedObjects 103 to become unreachable, and therefore cause their destruction. In order to prevent erroneous recursive destruction of ManagedObject 103 containing the current NonOwningPointer 104 by composition, the destructor of the NonOwningPointer 104 sets that ManagedObject's bInDestructor attribute to true before it calls the nullify( ) method, and sets it to false upon return.
When an instance of class ManagedObject 103 is destroyed, its destructor is invoked. The destructor sets Boolean attribute bInDestructor to true, then walks the list of NonOwningPointers 104 whose head is pointed to by the attribute pFirstRef, and invokes the nullify( ) method on each pointer encountered. As a result, the destruction of an object of class ManagedObject 103 causes all NonOwningPointers 104 which reference it to be nullified. Upon completion, the destructor sets Boolean attribute bInDestructor to false.
The nullification of a NonOwningPointer 104 can result in ManagedObject 103 becoming unreachable, and if this occurs, ManagedObject 103 is destroyed by the nullify( ) method of NonOwningPointer 104, as described above. The Boolean attribute bInDestructor prevents the erroneous recursive destruction of ManagedObject 103. The destruction of ManagedObject 103 may result in the destruction of NonOwningPointers 104 it may contain to other objects, which may result in the further destruction of ManagedObjects 103 if they become non-reachable.
It is preferred to prohibit ordinary pointers from referencing managed objects, because the mechanisms described above cannot be implemented on them. The present invention preserves the invariant in the system that every managed object is reachable or there are no managed objects. Upon creation, every managed object is reachable by the invocation that created it. When an invocation exits, its owning and non-owning pointers are destroyed. As explained above, the destruction of such a pointer causes the system to determine whether the managed object to which it pointed is still reachable. If it is not, the system destroys the managed object, and any other managed objects that were reachable solely through it. Thus, all managed objects existing at any time in the system are guaranteed to be reachable. It can be seen from the above that, if all non-reachable managed objects are immediately destroyed, no memory leaks occur.
It is desirable to resolve the prior art problem of dangling pointers, which is where a pointer to a managed object may continue to exist after the object is de-allocated. It will be noted that an owner can explicitly destroy a managed object, if it is the sole direct owner at that time. The garbage collection method described herein solves the problem of dangling pointers, by guaranteeing that, when a managed object is destroyed, all non-owning pointers to it are nullified.
While the preferred embodiment uses a singly linked list of NonOwningPointers, other data structures, such as a doubly linked list or a hash table of pointers, may be used without departing from the spirit and scope of the invention. Also, a mechanism to defer the destruction of an object found to be no longer reachable may be employed; such is within the scope of the invention, as the object is found to be no longer reachable as soon as that condition is true.
Mechanisms embodying methods of the present invention are incorporated into a programming language. Software which organizes free memory as a heap allocates extra bytes at the beginning of each requested allocation block, to save the attributes of a managed object as described above. The three types of pointers described above are intrinsic to the programming language. The programming language enforces the rules described above regarding the use of pointers with regard to managed objects.
The above description implicitly assumes that all of the managed objects, and the invocations which create them, are running in the same single thread of control. The above mechanism is implemented for a free store (usually a heap) shared by multiple threads of control within a single process, as follows. A single synchronizing lock accessible to all threads of the process serializes allocation operations within the shared free store. If an object is to be made accessible by multiple threads, the object is allocated and managed within the shared free store as follows. When a managed shared object is allocated, it is associated with its own synchronizing lock. All operations on a managed shared object, including the operations described above and other user-defined operations if any, whether invoked by owning or non-owning pointers, or invoked by other code, are serialized on that lock.
Objects not shared by multiple threads are allocated in a free store accessible to only one thread. Neither that free store nor managed objects allocated within it has synchronizing locks. As previously stated, this is implicitly assumed in the prior description. Access to these objects is more efficient, since locking and serialization is not necessary.
The above description also implicitly assumes that all of the managed objects, and the invocations which create them, are running in the same process. The above mechanism is implemented for a free store (usually a heap) shared by multiple processes using shared memory, as follows. A single synchronizing lock, accessible to all processes of the system, serializes allocation operations within the shared memory. If an object is to be made accessible by multiple processes, the object is allocated and managed within the shared memory as follows. When a managed shared object is allocated, it is associated with its own synchronizing lock. All operations on a managed shared object, including the operations described above and other user-defined operations if any, whether invoked by owning or non-owning pointers, or invoked by other code, are serialized on that lock.
Objects not shared by multiple processes are allocated in a free store accessible to only one process. The objects may be allocated in a free store accessible by multiple threads or in a free store accessible by a single thread, as described above.
The mechanism as extended for multi-processing is implemented for a system that persists (saves) objects between invocations of a process, as follows. An eternal system is some entity that exists outside any process of the system, for example an object persistence system, that is deemed to have a lifetime longer than that of any managed object allocated within any process of the system. The eternal system incorporates owning pointers and non-owning pointers as described above. It an object is owned by the eternal system, or is reachable by the eternal system, then it persists. As soon as an object is no longer reachable from the eternal system, it is destroyed.
POSIX®-compliant file systems are defined by “IEEE/ANSI Std 1003.1, 1996 Edition: Information Technology—Portable Operating System Interface (POSIX&)—Part 1: System Application: Program Interface (API) [C Language]”, which is incorporated herein by reference. The present invention mat be utilized to access POSIX®-compliant file systems.
In the POSIX® file system, a file persists as long as it is reachable from the root directory, and is destroyed as soon as it is no longer reachable from the root directory and no program has it opened for access. A file is made reachable by storing a <name, inode> pair as an entry in a directory, where the directory is either the root directory or a directory reachable from the root directory, and an inode identifies the file. A directory is itself a special kind of file. A POSIX®-compliant file system allows multiple named directory entries to reference the same node number. According to the POSIX® specification, as soon as the last directory entry referencing a file's inode is removed, the file itself is destroyed, unless the file is currently open by one or more programs, in which case destruction is deferred until the last program closes the file. When a program opens a file, the operating system gives to the program a file handle that represents its access to that file.
Classes derived from the classes described earlier are implemented to wrap corresponding aspects of POSIX®-compliant file systems as follows. Files are represented in programs as instances of a class derived from the class ManagedObject. Methods of the derived class implement file system operations such as reading and writing, but do not support opening, closing, creating, or destroying files. These are supported through a subclass of OwningPointer, as will be seen below.
A class derived from OwningPointer represents file handles. An instance of the derived class that is not null represents a file that is currently opened by the program containing the instance. The creation of a non-null instance includes the opening of a file. The derived class contains methods to create non-null pointers that correspond to the functions specified by POSIX®-compliant file systems for creating new files and opening existing files. The nullification of an instance of the derived class includes the closing of the corresponding file. The copying of an instance of the derived class causes the duplication of the file handle it contains.
Note that no class derived from NonOwningPointer is defined to represent directory entries in programs. This is unlike the mechanisms described earlier. However, this restriction is no way affects the utility of the invention, as such restriction arises from the specification of POSIX®-compliant file systems, and a more versatile mechanism such as is possible in memory-resident objects is of no value in this case.
In like manner, the present invention may also be used to enable access to systems similar to POSIX®-compliant file systems.
As described above, the present invention can be embodied in the form of computer-implemented processes and apparatuses for practicing those processes. The present invention can also be embodied in the form of computer program code containing instructions embodied in tangible media, such as floppy diskettes, CD-ROM's, hard drives, or any other computer-readable storage medium, wherein, when the computer program code is loaded into and executed by a computer, the computer becomes an apparatus for practicing the invention. The present invention can also be embodied in the form of computer program code, for example, whether stored in a storage medium, loaded into and/or executed by a computer, or transmitted over some transmission medium (embodied in the form of a propagated signal propagated over a propagation medium), such as over electrical wiring or cabling, through fiber optics, or via electromagnetic radiation, wherein, when the computer program code is loaded into and executed by a computer, the computer becomes an apparatus for practicing the invention. When implemented on a general-purpose microprocessor, the computer program code segments configure the microprocessor to create specific logic circuits.
While preferred embodiments have been shown and described, various modifications and substitutions may be made thereto without departing from the spirit and scope of the invention. Accordingly, it is to be understood that the present invention has been described by way of illustrations and not limitations.
|Patente citada||Fecha de presentación||Fecha de publicación||Solicitante||Título|
|US4755939||24 Nov 1986||5 Jul 1988||International Computers Limited||Garbage collection in a computer system|
|US4775932 *||31 Jul 1984||4 Oct 1988||Texas Instruments Incorporated||Computer memory system with parallel garbage collection independent from an associated user processor|
|US5398334||6 Abr 1992||14 Mar 1995||General Electric Company||System for automatic garbage collection using strong and weak encapsulated pointers|
|US5652883||23 May 1995||29 Jul 1997||Microsoft Corporation||Computer method and system for conservative-stack and generational heap garbage collection|
|US5799185 *||29 Mar 1996||25 Ago 1998||Fuji Xerox Co., Ltd.||Method and system for managing system memory reclamation|
|US5848423||23 Abr 1997||8 Dic 1998||Sun Microsystems, Inc.||Garbage collection system and method for locating root set pointers in method activation records|
|US5900001||23 Abr 1997||4 May 1999||Sun Microsystems, Inc.||Method and apparatus for optimizing exact garbage collection using a bifurcated data structure|
|US5903899||23 Abr 1997||11 May 1999||Sun Microsystems, Inc.||System and method for assisting exact Garbage collection by segregating the contents of a stack into sub stacks|
|US5960087 *||1 Jul 1996||28 Sep 1999||Sun Microsystems, Inc.||Distributed garbage collection system and method|
|US6094664 *||30 May 1997||25 Jul 2000||Sun Microsystems||Method and apparatus for optimizing the null pointer exception in an object-oriented programming environment with statically typed variables|
|US6144965 *||24 Sep 1997||7 Nov 2000||Sony Corporation||Performing memory management in an object-oriented programming environment|
|US6421690 *||29 Abr 1999||16 Jul 2002||Honeywell International Inc.||Computer memory management system|
|US6473773 *||6 Jun 1998||29 Oct 2002||International Business Machines Corporation||Memory management in a partially garbage-collected programming system|
|US6487563 *||23 Mar 2000||26 Nov 2002||Koninklijke Philips Electronics N.V.||Memory reclamation method|
|US6799191 *||15 May 2001||28 Sep 2004||Sun Microsystems, Inc.||Object sampling technique for runtime observations of representative instances thereof|
|US7469324 *||7 Ene 2005||23 Dic 2008||Azul Systems, Inc.||System and method for concurrent compacting self pacing garbage collection using loaded value and access barriers|
|US7584232 *||22 Ene 2007||1 Sep 2009||Mingnan Guo||System and method for computer automatic memory management|
|US20010037412||9 Mar 2001||1 Nov 2001||Miloushev Vladimir I.||Method and system for constructing software components and systems as assemblies of independent parts|
|US20060155791 *||7 Ene 2005||13 Jul 2006||Azul Systems, Inc.||System and method for concurrent compacting self pacing garbage collection using loaded value and access barriers|
|US20070203960 *||22 Ene 2007||30 Ago 2007||Mingnan Guo||System and method for computer automatic memory management|
|1||"D Programming Language"-Digital Mars, 1999-2002.|
|2||"D Programming Language"—Digital Mars, 1999-2002.|
|3||Horstmann, Cay S. "Memory management and smart pointers." In C++ Report, 5,3 (Mar./Apr. 1993), 28-34. New York: 101 Communications, 1993.|
|Clasificación de EE.UU.||707/813, 711/E12.009, 711/170, 707/817|
|Clasificación internacional||G06F17/30, G06F12/02|
|Clasificación cooperativa||Y10S707/99957, Y10S707/99938, Y10S707/99939, G06F12/0261|
|16 Feb 2006||AS||Assignment|
Owner name: TAJEA CORPORATION, NEW JERSEY
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:HILLS, THEODORE S.;REEL/FRAME:017269/0689
Effective date: 20010221
|5 Ene 2011||AS||Assignment|
Owner name: MOUNT HAMILTON PARTNERS, LLC, CALIFORNIA
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:TAJEA CORPORATION;REEL/FRAME:025589/0559
Effective date: 20050802
Owner name: TAJEA, CORP., NEW JERSEY
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:HILLS, THEODORE S.;REEL/FRAME:025589/0528
Effective date: 20010221
Owner name: TANGIE DATA HOLDINGS LLC, NEVADA
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:MOUNT HAMILTON PARTNERS, LLC;REEL/FRAME:025589/0642
Effective date: 20050916
|11 Oct 2011||CC||Certificate of correction|
|2 Jul 2015||REMI||Maintenance fee reminder mailed|
|25 Nov 2015||LAPS||Lapse for failure to pay maintenance fees|