Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4345774
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:04:57+00:00 2026-05-21T12:04:57+00:00

I am working on a toy language that uses C++ as an intermediate language,

  • 0

I am working on a toy language that uses C++ as an intermediate language, currently it only supports three types all decent from a base class, integer, list and lambda. All functions pass base class back and forth. Compiled code runs on a microcontoller, which means there are certain restrictions I only have 8 kb of ram so ideally I want to get rid of the object as soon as I am done with it. Also I don’t have access to most of the standart libs (no Boost, STL etc..).

So my question is how should i attack this problem? When I started I though I would just use shared pointers but that turns out does not really work say when a bunch of integers are added to a list.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T12:04:58+00:00Added an answer on May 21, 2026 at 12:04 pm

    I know of two general mechanisms for garbage collection:

    • Reference Counting
    • Mark And Sweep

    There are various flavors / improvements which correspond more to implementations strategies (Generational, Copying, Compacting, …).

    In general, the Reference Counting is the best for reactivity (which is important here), however there is the issue of reference cycles (depending on your toy language semantics).

    There are complicated algorithms to deal with the collection of cycle, but the simpler solution is:

    • Use Reference Counting for on-line maintenance
    • Perform a full “Mark-And-Sweep” collection whenever the memory reaches a defined treshold to collect the leaked cycles
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine I have a stack-based toy language that comes with the operations Push, Pop,
I am working on an interpreter for a toy language, just to learn about
I'm currently working on a toy project in Django. Part of my app allows
I am using shared_ptr as my garbage collection for a toy language that I
Working with a SqlCommand in C# I've created a query that contains a IN
Working on a project that parses a log of events, and then updates a
Working with an Oracle 9i database from an ASP.NET 2.0 (VB) application using OLEDB.
I'm trying to write my own toy My Toy Language -> MSIL compiler in
We are working on a toy operating system as a assignment for a class.
I am working on a small toy project who is getting more and more

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.