Chaga Programming Language: Chapter 6: Pointers

Pre-defined functions

  • user_reserved_memory() is a function which returns two parameters:
    • An array of pointers to all memory allocated by the user's program from the heap.
    • The number of elements in the array.
  • defragment_user_memory() is a function which consolidates memory allocated to the current user's program from the heap.
    • The goal is to defragment memory allocated allocations.
    • All pointers into former user space must be updated to the new (preferred) memory locations after the defragment process.
    • Not sure how to implement this yet but fragmented memory is a concern.

Copyright © 2025, 2026 Robert James Bruce.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at https://www.gnu.org/licenses/fdl-1.3.html