summaryrefslogtreecommitdiff
path: root/src/scheme/ao_scheme_mem.c
Commit message (Collapse)AuthorAge
* altos/scheme: Move ao-scheme to a separate repositoryKeith Packard2018-01-10
| | | | | | This way it can be incorporated into multiple operating systems more easily. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/scheme: Add ports. Split scheme code up.Keith Packard2018-01-06
| | | | | | And lots of other changes, including freeing unreferenced atoms. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/scheme: Replace per-type indexed stash with poly stash heapKeith Packard2017-12-19
| | | | | | | Instead of having a random set of stash arrays with explicit indices used by callers, just have a general heap. Less error prone, and less code. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/scheme: Replace memory pool macros with inlinesKeith Packard2017-12-19
| | | | | | | | | | AO_SCHEME_IS_CONST -> ao_scheme_is_const_addr AO_SCHEME_IS_POOL -> ao_scheme_is_pool_addr Provides better typechecking and avoids confusion with ao_scheme_is_const inline (which takes an ao_poly instead of a void *) Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/scheme: Rework display/write codeKeith Packard2017-12-19
| | | | | | | | | | Unify output functions and add bool to switch between write and display mode. Make that only affect strings (as per r⁷rs). Use print recursion detection in frame and stack code, eliminating PRINT flags in type field. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/scheme: Work around gcc 7.2.0 optimization bug in memory managerKeith Packard2017-12-18
| | | | | | | | | | | | | After marking a set of memory chunks, it's possible that all of them will be packed tight against 'top', in which case none of them will be moving. In that case, gcc 7.2.0 appears to generate incorrect code causing the loop to be abandoned, meaning that we don't actually collect anything at all. Add a quick short-circuit test just after the mark phase that skips the code which wouldn't do anything in this case. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/scheme: rearrange debugging definesKeith Packard2017-12-18
| | | | | | | Allow applications to redefine these as desired, add more flexibility in what the various memory debugging flags can do. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/scheme: Use memory manager mark code to note recursive printKeith Packard2017-12-17
| | | | | | | This flags any object being printed and checks before recursing to avoid infinite loops. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/scheme: swap BIGINT and STRING typesKeith Packard2017-12-14
| | | | | | | | This lets BIGINT be a primitive type, allowing it to use all 32 bits for storage. This does make strings another byte longer, and also slightly harder to deal with. It's a trade off. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/scheme: inline some mem calls to reduce stack usage.Keith Packard2017-12-12
| | | | | | Also includes some code to display stack usage during collect calls. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/scheme: Support scheme subsetting via feature settingsKeith Packard2017-12-12
| | | | | | | This provides for the creation of smaller versions of the interpreter, leaving out options like floating point numbers and vectors. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/scheme: Use 64-bit ints to track memory allocation statsKeith Packard2017-12-11
| | | | | | | These are only collected for debug purposes, but can get quite large if the interpreter runs for a while. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/scheme: Add vectorsKeith Packard2017-12-10
| | | | | | Constant time and smaller can be a feature. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/scheme: Rename to 'scheme', clean up buildKeith Packard2017-12-05
Constant block is now built in a subdir to avoid messing up source directory. Renamed to ao_scheme to reflect language target. Signed-off-by: Keith Packard <keithp@keithp.com>