Notes Summary In this assignment, you are to implement a simple object manager.
ID: 3532717 • Letter: N
Question
Notes
Summary
In this assignment, you are to implement a simple object manager. An object manager is another form of table, but we now store generic objects in a managed buffer (the internal implementation of a table varies based on need). Using a buffer means that we must directly manage the memory and references to objects. This means that our object manager must implement reference counting and a garbage collector, so that we properly handle creation and deletion of objects. The object manager's interface is given by the file ObjectManager.h(posted on the Assignments page) and the implementation will be in the file ObjectManager.c. Your task is to implement the functions required for the object manager. This includes all the functions listed in ObjectManager.h, along with any (private) static functions that will be useful. You will also need to define appropriate data types and data structures for keeping track of the objects that have been allocated. You are NOT allow to change the prototypes of the functions that are provided to you in ObjectManager.h. To summarize, the functionalities you have to implement are:
A more thorough discussion of the functionality of these routines will be discussed in class.
Garbage Collection
You will implement a Mark and Sweep Defragmenting garbage collector, as described in class. This function is called compact() in the object manager. So that we can evaluate your implementation, every time the garbage collector runs print out the following statistics (to stdout):
Data Structures
You must manage the tracking of allocated objects using an index, which will be implemented using a linked list. Each node in your linked list contains the information needed to manage its associated object. Note that the index is implemented inside the object manager, you don't need any additional files.
Testing your Object Manager
You will (eventually) be provided with several files (containing the main() function) for testing your object manager (here's a really simplemain.c file to get you started). In the meantime, you'll have to use some of your new found testing and debugging skills to ensure your code can handle anything I might throw at it -- at a minimum, the code you hand in must use assertions, etc as required for assignments 2 and 3. Note that the main files will arrive very late in the game. If you wait until they're available there's no way you'll finish the assignment on time.
Other Comments
Hand In/Marking
In addition to the usual requirements, you will have to deal the following for this assignment:
Explanation / Answer
http://blog.codexplo.org/2012/10/11/design-paradigm-object-manager/
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.