-
Notifications
You must be signed in to change notification settings - Fork 32
[copy_gc & mark_sweep] Developer Documentation
Bryan Loh edited this page Apr 22, 2021
·
1 revision
This module is a series of memory management visualisation: copy_gc and mark_sweep written by developer Violin Yap.
Refer to API documentation for copy_gc here. Refer to API documentation for mark_sweep here.
- Learn more about Source Modules here.
- Make sure you have some knowledge in React and Typescript.
- Note that this visualisation is based on our own implementation of memory management methods.
- Have fun!
All functions are stored within src/bundles/copy_gc or src/bundles/mark_sweep while TSX part are stored in src/tabs/CopyGC or src/tabs/MarkSweep. The folders contains the following files (same for both mark_sweep and copy_gc:
Bundles
-
index.ts- Contains all the function and API used within the scope of the module -
type.ts- Contains the types defined within the module
Tabs
-
index.tsx- Contains all the TSX and React part of the implementation. -
style.tsx- Contains color declaration that is used within the module.
This applies for both copy_gc and mark_sweep.
- The API can be called from Source Academy Playground if it is exported in function
export default function mark_sweep()(orcopy_gc) located at the bottom ofindex.ts -
index.tsxcan 'communicate' withindex.tsthroughinit()function inindex.tsthat will pass its returned value throughdebuggerContextinindex.tsxonce the function is invoked in the running Source program. - A tab will show if the user import
copy_gcormark_sweep. - Memory layout will only be shown after the user successfully invoke
initialize_memory()function.
These modules are built as part of CS4215 Programming Language Implementation project. To leverage on the implementation, here are some advancements that can be done:
- Viewing memory content of each node and also its children.
- Customisable and more generalised methods. We haven't get the chance to try and test out our visualisation with other way of Stop and Copy and Mark and Sweep garbage collection implementation so this can be a further exploration for the next project.
- More exception messages and error handling.
- Customisable color choice and more! You can explore the code to find out.
- Home
- Overview
- System Implementation
-
Development Guide
- Getting Started
- Repository Structure
-
Creating a New Module
- Creating a Bundle
- Creating a Tab
- Writing Documentation
- Developer Documentation (TODO)
- Build System
- Source Modules
- FAQs
Try out Source Academy here.
Check out the Source Modules generated API documentation here.