Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "tagged memory"?

Tags:

memory

What is "tagged memory" and how does it help in reducing program size?


2 Answers

You may be referring to a tagged union, or more specifically a hardware implementation like the tagged architecture used in LISP machines. Basically a method for storing data with type information.

In a LISP machine, this was done in-memory by using a longer word length and using some of the extra bits to store type information. Handling and checking of tags was done implicitly in hardware.

For a type-safe C++ implementation, see boost:variant.

like image 154
jrg Avatar answered Sep 17 '25 20:09

jrg


Not sure, but it is possible that you are referring to garbage collection, which is the process of automatically disposing of no longer used objects created when running a program.

"Tagged memory" can be a synonym for mark-and-sweep, which is the most basic way to implement garbage collection.

If this is all wrong, please edit your question to clarify.

like image 41
unwind Avatar answered Sep 17 '25 20:09

unwind



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!