Giter Club home page Giter Club logo

gcutil's Introduction

Garbage collector for Pando

Based on 'Boehm-Demers-Weiser Garbage Collector'.

Terms

Roots

Generally roots mean pointers stored in statically allocated or stack allocated program variables.
A mark-sweep garbage collector traverses all reachable objects in the heap (more accurately it's gc heap in our case) by following pointers beginning with the roots.
In this project roots include followings,

  • (Add here)
  • (Add here)

Garbage-collected heap

(TODO)

(Add term here)

...

Coding guide

Interaction with the system malloc

It is usually best not to mix garbage-collected allocation with the system malloc-free. If you do, you need to be careful not to store pointers to the garbage-collected heap in memory allocated with the system malloc.

Using std::vector (1)

You need to be careful using std::vector since it allocates memory for its elements internally.
It allocates based on the allocator you pass in at construction. If you didn't specify one, you get the default allocator and it will allocate on the native heap!
So it is needed to specify GC allocator for the std::vector with elements that may have GC pointers.

To elaborate, at mark phase, GC start to scan pointer-like values and checks if the values belong to the GC heap. But if we allocate on the native heap using std allocator, the ranges are out of GC heap range, so GC ignores the values.

Using std::vector (2)

It is not recommended to use std::vector, because its std::vector::end points next space of the last element which makes GC think it as a non-collectable space! Please refer here.

(Add here)

gcutil's People

Contributors

bwikbs avatar clover2123 avatar june0cho avatar ksh8281 avatar rabbitfor avatar repasics avatar ryanhc avatar seungsoo47 avatar sonwow avatar yichoi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.