bldc/include/heap.h

868 lines
26 KiB
C
Raw Normal View History

/*
Copyright 2018 , 2022 Joel Svensson svenssonjoel@yahoo.se
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** \file heap.h */
#ifndef HEAP_H_
#define HEAP_H_
#include <string.h>
#include "lbm_types.h"
#include "symrepr.h"
#include "stack.h"
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
#include "lbm_memory.h"
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
#include "lbm_defines.h"
#include "lbm_channel.h"
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
#ifdef __cplusplus
extern "C" {
#endif
/*
Planning for a more space efficient heap representation.
TODO: Need to find a good reference to read up on this.
- List based heap
- Easy to implement and somewhat efficient
0000 0000 Size Free bits
003F FFFF 4MB 10
007F FFFF 8MB 9
00FF FFFF 16MB 8
01FF FFFF 32MB 7
03FF FFFF 64MB 6 * Kind of heap size I am looking for
07FF FFFF 128MB 5
0FFF FFFF 256MB 4
1FFF FFFF 512MB 3
--- May 9 2021 ---
Actually now I am much more interested in way smaller memories ;)
0000 0000 Size Free bits
0000 0FFF 4KB 20 |
0000 1FFF 8KB 19 |
0000 3FFF 16KB 18 |
0000 7FFF 32KB 17 |
0000 FFFF 64KB 16 |
0001 FFFF 128KB 15 |
0003 FFFF 256KB 14 | - This range is very interesting.
0007 FFFF 512KB 13
000F FFFF 1MB 12
001F FFFF 2MB 11
003F FFFF 4MB 10
007F FFFF 8MB 9
00FF FFFF 16MB 8
01FF FFFF 32MB 7
03FF FFFF 64MB 6
07FF FFFF 128MB 5
0FFF FFFF 256MB 4
1FFF FFFF 512MB 3
Those are the kind of platforms that are fun... so a bunch of
wasted bits in heap pointers if we run on small MCUs.
-----------------
it is also the case that not all addresses will be used if all "cells" are
of the same size, 8 bytes...
value 0: 0000 0000
value 1: 0000 0008
value 3: 0000 0010
value 4: 0000 0018
Means bits 0,1,2 will always be empty in a valid address.
Cons cells also need to be have room for 2 pointers. So each allocated cell from
memory should be 8bytes.
Things that needs to be represented within these bits:
- GC MARK one per cell
- TYPE: type of CAR and type of cons
Types I would want:
- Full 32bit integer. Does not leave room for identification of type
- Float values. Same problem
Free bits in pointers 64MB heap:
31 30 29 28 27 26 2 1 0
0 0 0 0 0 0 XX XXXX XXXX XXXX XXXX XXXX X 0 0 0
Information needed for each cell:
Meaning | bits total | bits per car | bits per cdr
GC mark | 2 | 1 | 1 - only one of them will be used (the other is wasted)
Type | 2x | x | x
Ptr/!ptr | 2 | 1 | 1
Types (unboxed):
- Symbols
- 28bit integer ( will need signed shift right functionality )
- 28bit unsigned integer
- Character
If four types is all that should be possible (unboxed). then 2 bits are needed to differentiate.
2 + 1 + 1 = 4 => 28bits for data.
bit 0: ptr/!ptr
bit 1: gc
bit 2-3: type (if not ptr)
bit 3 - 24 ptr (if ptr)
bit 4 - 31 value (if value)
An unboxed value can occupy a car or cdr field in a cons cell.
types (boxed) extra information in pointer to cell can contain information
- 32 bit integer
- 32 bit unsigned integer
- 32 bit float
boxed representation:
[ptr| cdr]
|
[Value | Aux + GC_MARK]
Kinds of pointers:
- Pointer to cons cell.
- Pointer to unboxed value (fixnums not in a list, I hope this is so rare that it can be removed )
- integer
- unsigned integer
- symbol
- float
- Pointer to boxed value.
- 32 bit integer
- 32 bit unsigned integer
- 32 bit float
- (Maybe something else ? Vectors/strings allocated in memory not occupied by heap?)
- vector of int
- vector of uint
- vector of float
- vector of double
- String
13 pointer"types" -> needs 4 bits
for 64MB heap there are 6 free bits. So with this scheme going to 128MB or 256MB heap
is also possible
a pointer to some off heap vector/string could be represented by
[ptr | cdr]
|
[full pointer | Aux + GC_MARK]
|
[VECTOR]
Aux bits could be used for storing vector size. Up to 30bits should be available there
>> This is problematic. Now the information that something is a vector is split up
>> between 2 cons cells. This means GC needs both of these intact to be able to make
>> proper decision.
>> Will try to resolve this by adding some special symbols. But these must be symbols
>> that cannot occur normally in programs. Then an array could be:
[Full pointer | ARRAY_SYM + GC_MARK]
|
[VECTOR]
>> Boxed values same treatment as above.
>> TODO: Could this be simpler?
[ VALUE | TYPE_SYM + GC_MARK]
0000 00XX XXXX XXXX XXXX XXXX XXXX X000 : 0x03FF FFF8
1111 AA00 0000 0000 0000 0000 0000 0000 : 0xFC00 0000 (AA bits left unused for now, future heap growth?)
*/
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
#ifndef LBM64
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
#define LBM_ADDRESS_SHIFT 2
#define LBM_VAL_SHIFT 4
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
#define LBM_PTR_MASK 0x00000001u
#define LBM_PTR_BIT 0x00000001u
#define LBM_PTR_VAL_MASK 0x03FFFFFCu
#define LBM_PTR_TYPE_MASK 0xFC000000u
#else /* 64 bit Version */
#define LBM_ADDRESS_SHIFT 2
#define LBM_VAL_SHIFT 8
#define LBM_PTR_MASK (lbm_uint)0x1
#define LBM_PTR_BIT (lbm_uint)0x1
#define LBM_PTR_VAL_MASK (lbm_uint)0x03FFFFFFFFFFFFFC
#define LBM_PTR_TYPE_MASK (lbm_uint)0xFC00000000000000
#endif
/** Struct representing a heap cons-cell.
*
*/
typedef struct {
lbm_value car;
lbm_value cdr;
} lbm_cons_t;
/**
* Heap state
*/
typedef struct {
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
lbm_cons_t *heap;
lbm_value freelist; // list of free cons cells.
lbm_stack_t gc_stack;
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
lbm_uint heap_size; // In number of cells.
lbm_uint heap_bytes; // In bytes.
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
lbm_uint num_alloc; // Number of cells allocated.
lbm_uint num_alloc_arrays; // Number of arrays allocated.
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
lbm_uint gc_num; // Number of times gc has been performed.
lbm_uint gc_marked; // Number of cells marked by mark phase.
lbm_uint gc_recovered; // Number of cells recovered by sweep phase.
lbm_uint gc_recovered_arrays;// Number of arrays recovered by sweep.
lbm_uint gc_least_free; // The smallest length of the freelist.
lbm_uint gc_last_free; // Number of elements on the freelist
// after most recent GC.
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
lbm_uint gc_time_acc;
lbm_uint gc_min_duration;
lbm_uint gc_max_duration;
} lbm_heap_state_t;
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
extern lbm_heap_state_t lbm_heap_state;
/**
* The header portion of an array stored in array and symbol memory.
*/
typedef struct {
lbm_type elt_type; /// Type of elements: VAL_TYPE_FLOAT, U, I or CHAR
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
lbm_uint size; /// Number of elements
lbm_uint *data; /// pointer to lbm_memory array or C array.
} lbm_array_header_t;
/** Initialize heap storage.
* \param addr Pointer to an array of lbm_cons_t elements. This array must at least be aligned 4.
* \param num_cells Number of lbm_cons_t elements in the array.
* \param gc_stack_storage uint32_t pointer to space to use as "recursion" stack for GC
* \param gc_stack_size Size of the gc_stack in number of words.
* \return 1 on success or 0 for failure.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
int lbm_heap_init(lbm_cons_t *addr, lbm_uint num_cells,
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
lbm_uint *gc_stack_storage, lbm_uint gc_stack_size);
/** Add GC time statistics to heap_stats
*
* \param dur Duration as reported by the timestamp callback.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
void lbm_heap_new_gc_time(lbm_uint dur);
/** Add a new free_list length to the heap_stats.
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
* Calculates a new freelist length and updates
* the GC statistics.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
void lbm_heap_new_freelist_length(void);
/** Check how many lbm_cons_t cells are on the free-list
*
* \return Number of free lbm_cons_t cells.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
lbm_uint lbm_heap_num_free(void);
/** Check how many lbm_cons_t cells are allocated.
*
* \return Number of lbm_cons_t cells that are currently allocated.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
lbm_uint lbm_heap_num_allocated(void);
/** Size of the heap in number of lbm_cons_t cells.
*
* \return Size of the heap in number of lbm_cons_t cells.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
lbm_uint lbm_heap_size(void);
/** Size of the heap in bytes.
*
* \return Size of heap in bytes.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
lbm_uint lbm_heap_size_bytes(void);
/** Allocate an lbm_cons_t cell from the heap.
*
* \param type A type that can be encoded onto the cell (most often LBM_PTR_TYPE_CONS).
* \return An lbm_value referring to a cons_cell or enc_sym(SYM_MERROR) in case the heap is full.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
lbm_value lbm_heap_allocate_cell(lbm_type type);
/** Decode an lbm_value representing a string into a C string
*
* \param val Value
* \return String or NULL if the value does not encode a string.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
char *lbm_dec_str(lbm_value val);
/** Decode an lbm_value representing a char channel into an lbm_char_channel_t pointer.
*
* \param val Value
* \return A pointer to an lbm_char_channel_t or NULL if the value does not encode a channel.
*/
lbm_char_channel_t *lbm_dec_channel(lbm_value val);
Squashed 'lispBM/lispBM/' changes from 3836952f..cdfd116c cdfd116c added some tests for partial applications 46d02e9c Added the possibilty to partially apply a closure 788dfa27 debug inspection of local environments in the REPL b28ceec1 shutting down some warnings originating in repl.c d35ef54d small tweak example code 5fa6f453 added some sanity checking of the type of the key used in let bindings 81314729 Updates chibios xmas-dac example so that it builds again 0d1f05ca updates chibios example repl so that it builds again 4ae17fc8 small tweak to texture loading demo. a309e37a added silly texture image for the sdl_texture.lisp example 1dc0e4e6 added texture loading extension and a blit function for drawing sprites on the window 6c249a37 proper scaling on the sleep and timestamp callbacks e65b0b83 ESP32c3 repl up and running 24f93026 work in progress esp32 repl 958a273d work in progress esp32 repl d4fb301b work in progress repl example for ESP platforms (esp32c3 specifically) 7e924bf6 freertos includes correctly, compiles. stiill untested 29b9e3a4 added freeRTOS platform files. Untested currently f3931c13 update README and small tweaks 357bb438 closing one warning 205ca17e small tweak to SDL tree-demo 27c1f601 added a way to explicitly run a custom type destructor and clean up its deference trampoline d955f26e added missing files a94dfb5c Update README.md 0e29e692 added SDL example that draws a tree a5417886 Bugfix in lbm_sdl.c for destructors of window and renderer b3a0e586 Getting started with interfacing LBM and SDL2 7aa2c1d0 started towards custom types with associated destructors for when they are freed by GC a8b33a8d safer behaviour of car and cdr in relation to pointer-types that are not really cons-cells 9fbf02ce fixed some inconsistencies 3051e8e7 update change log 8d002536 handling one warning in 64 bit compile 7794a9b2 added array tests a83f385c Merge branch 'master' of github.com:svenssonjoel/lispbm 21c79aaf fix problem with array parsing in the case of float arrays dc926e59 added script to generate ctags 38046a49 updates to changelog with changes up and including may 22 2022 45b5d6c0 fix potential corner case issue with call-cc on 64 bit platforms ebb100a5 some streamlining of the bind_to_key rest continuation in eval_cps.c 1c9a7df2 Added explicit stack version of defunctionalized evaluator example 2812b7b0 added some more testcases in evaluator.lisp and evaldefunc.lisp 0393bd21 New features in evaluator.lisp and evaldefunc.lisp c6dd4e10 found an evalutor bug related to progn thanks to writing evaluator.lisp and evaldefunc.lisp 5d1bfc75 added continuation passing style evaluator of a mini-lisp as well as a defunctionalized CPS style evaluator for the same mini-lisp a5a6c2a2 removed commented out old code c135b4a3 fix problem related to assoc 8ddd44cc removed some code duplication in eval_cps c625af8e lbmref update a1a7a4b6 lbmref update 12d9f4e9 lbmref update git-subtree-dir: lispBM/lispBM git-subtree-split: cdfd116c655e20bac787a2080b8c601c6bc846ca
2022-07-06 01:18:45 -07:00
/** Decode an lbm_value representing a custom type into a lbm_uint value.
*
* \param val Value.
* \return The custom type payload.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
lbm_uint lbm_dec_custom(lbm_value val);
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
/** Decode a numerical value as if it is char
*
* \param val Value to decode
* \return The value encoded in val casted to a char. Returns 0 if val does not encode a number.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
char lbm_dec_as_char(lbm_value a);
/** Decode a numerical value as if it is unsigned
*
* \param val Value to decode
* \return The value encoded in val casted to an unsigned int. Returns 0 if val does not encode a number.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
uint32_t lbm_dec_as_u32(lbm_value val);
/** Decode a numerical value as a signed integer.
*
* \param val Value to decode
* \return The value encoded in val casted to a signed int. Returns 0 if val does not encode a number.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
int32_t lbm_dec_as_i32(lbm_value val);
/** Decode a numerical value as a float.
*
* \param val Value to decode.
* \return The value encoded in val casted to a float. Returns 0 if val does not encode a number.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
float lbm_dec_as_float(lbm_value val);
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
/** Decode a numerical value as if it is a 64bit unsigned
*
* \param val Value to decode
* \return The value encoded in val casted to an unsigned int. Returns 0 if val does not encode a number.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
uint64_t lbm_dec_as_u64(lbm_value val);
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
/** Decode a numerical value as a 64bit signed integer.
*
* \param val Value to decode
* \return The value encoded in val casted to a signed int. Returns 0 if val does not encode a number.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
int64_t lbm_dec_as_i64(lbm_value val);
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
/** Decode a numerical value as a float.
*
* \param val Value to decode.
* \return The value encoded in val casted to a float. Returns 0 if val does not encode a number.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
double lbm_dec_as_double(lbm_value val);
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
lbm_uint lbm_dec_raw(lbm_value v);
/** Allocates an lbm_cons_t cell from the heap and populates it.
*
* \param car The value to put in the car field of the allocated lbm_cons_t.
* \param cdr The value to put in the cdr field of the allocated lbm_cons_t.
* \return A value referencing the lbm_cons_t or enc_sym(SYM_MERROR) if heap is full.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
lbm_value lbm_cons(lbm_value car, lbm_value cdr);
/** Accesses the car field of an lbm_cons_t.
*
* \param cons Value
* \return The car field of the lbm_cons_t if cons is a reference to a heap cell.
* If cons is nil, the return value is nil. If the value
* is not cons or nil, the return value is enc_sym(SYM_TERROR) for type error.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
lbm_value lbm_car(lbm_value cons);
Squashed 'lispBM/lispBM/' changes from ccca9778..db80cb7d db80cb7d updates to how symbols are evaluated, mostly for readability but also efficiency bb573b53 slight optimizations to mark_phase and mark_freelist 58242f41 tweaking the manual 51666fb5 update manual fix prelude situation 2c6349da work on manual 39a15fd8 update a5310055 added a bit more text about symbols in the manual 60d59eec added a bit more text about symbols in the manual f685819e added a bit more text about symbols in the manual 31d56d35 added a bit more text about symbols in the manual 54796c35 added a bit more text about symbols in the manual e333c00f Small readability and efficiency tweaks to eval_cps 0d234b5e lbm_cadr added and sligth modifications to eval_cps.c using lbm_cadr 85cd864a update changelog 6d2c8685 work on manual 5203a64f work on manual 63ebbae2 work on manual 4a146954 work on manual 19a0d06f work on manual 91c1d992 work on manual ab393f46 work on manual 26309199 work on manual c474931b work on manual 1a822e8d work on manual 648f6433 work on manual 6737828a work on manual 2d8e7084 work on manual 3a834fce work on manual 7ae1b342 work on manual bc5b1fd0 work on manual d3b6ec4d work on manual 654d70f8 writing on the manual 0d66dda6 tweak readme d846ea3b update README 2c18d1a6 small tweak bd9f80e5 allowing more characters in symbols 61827fc2 remove the prelude library in its current form. It is still available in the REPL f1dcea8f small tweak benchmarking code 3a761cee update manual e9898b19 make the prelude functions load dynamically when needed by the repl and test-system 714be360 update manual e1804e3e update lbmref, renamings 508d167c Update README.md 6f3207fa Update ch1_introduction.md 6562daef Update ch1_introduction.md 76b48adf work in progress proramming doc 91c44751 fix repl-cps makefile to correctly build deps 54e66b25 remove lbmref.dox f0c90ffd update reference manual 5b577572 fix potential bug in cont_application_start git-subtree-dir: lispBM/lispBM git-subtree-split: db80cb7dd05eef9e71980a55ff7987118c32c6e9
2022-04-12 01:44:49 -07:00
/** Accesses the car of the cdr of an cons cell
*
Squashed 'lispBM/lispBM/' changes from ccca9778..db80cb7d db80cb7d updates to how symbols are evaluated, mostly for readability but also efficiency bb573b53 slight optimizations to mark_phase and mark_freelist 58242f41 tweaking the manual 51666fb5 update manual fix prelude situation 2c6349da work on manual 39a15fd8 update a5310055 added a bit more text about symbols in the manual 60d59eec added a bit more text about symbols in the manual f685819e added a bit more text about symbols in the manual 31d56d35 added a bit more text about symbols in the manual 54796c35 added a bit more text about symbols in the manual e333c00f Small readability and efficiency tweaks to eval_cps 0d234b5e lbm_cadr added and sligth modifications to eval_cps.c using lbm_cadr 85cd864a update changelog 6d2c8685 work on manual 5203a64f work on manual 63ebbae2 work on manual 4a146954 work on manual 19a0d06f work on manual 91c1d992 work on manual ab393f46 work on manual 26309199 work on manual c474931b work on manual 1a822e8d work on manual 648f6433 work on manual 6737828a work on manual 2d8e7084 work on manual 3a834fce work on manual 7ae1b342 work on manual bc5b1fd0 work on manual d3b6ec4d work on manual 654d70f8 writing on the manual 0d66dda6 tweak readme d846ea3b update README 2c18d1a6 small tweak bd9f80e5 allowing more characters in symbols 61827fc2 remove the prelude library in its current form. It is still available in the REPL f1dcea8f small tweak benchmarking code 3a761cee update manual e9898b19 make the prelude functions load dynamically when needed by the repl and test-system 714be360 update manual e1804e3e update lbmref, renamings 508d167c Update README.md 6f3207fa Update ch1_introduction.md 6562daef Update ch1_introduction.md 76b48adf work in progress proramming doc 91c44751 fix repl-cps makefile to correctly build deps 54e66b25 remove lbmref.dox f0c90ffd update reference manual 5b577572 fix potential bug in cont_application_start git-subtree-dir: lispBM/lispBM git-subtree-split: db80cb7dd05eef9e71980a55ff7987118c32c6e9
2022-04-12 01:44:49 -07:00
* \param c Value
* \return the cdr field or type error.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
lbm_value lbm_cadr(lbm_value c);
/** Accesses the cdr field of an lbm_cons_t.
*
* \param cons Value
* \return The cdr field of the lbm_cons_t if cons is a reference to a heap cell.
* If cons is nil, the return value is nil. If the value
* if not cons or nil, the return value is enc_sym(SYM_TERROR) for type error.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
lbm_value lbm_cdr(lbm_value cons);
/** Update the value stored in the car field of a heap cell.
*
* \param c Value referring to a heap cell.
* \param v Value to replace the car field with.
* \return 1 on success and 0 if the c value does not refer to a heap cell.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
int lbm_set_car(lbm_value c, lbm_value v);
/** Update the value stored in the cdr field of a heap cell.
*
* \param c Value referring to a heap cell.
* \param v Value to replace the cdr field with.
* \return 1 on success and 0 if the c value does not refer to a heap cell.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
int lbm_set_cdr(lbm_value c, lbm_value v);
// List functions
/** Calculate the length of a proper list
* \warning This is a dangerous function that should be used carefully. Cyclic structures on the heap
* may lead to the function not terminating.
*
* \param c A list
* \return The length of the list. Unless the value is a cyclic structure on the heap, this function will terminate.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
unsigned int lbm_list_length(lbm_value c);
/** Reverse a proper list
* \warning This is a dangerous function that should be used carefully. Cyclic structures on the heap
* may lead to the function not terminating.
*
* \param list A list
* \return The list reversed or enc_sym(SYM_MERROR) if heap is full.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
lbm_value lbm_list_reverse(lbm_value list);
/** Reverse a proper list destroying the original.
* \warning This is a dangerous function that should be used carefully. Cyclic structures on the heap
* may lead to the function not terminating.
*
* \param list A list
* \return The list reversed
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
lbm_value lbm_list_destructive_reverse(lbm_value list);
/** Copy a list
* \warning This is a dangerous function that should be used carefully. Cyclic structures on the heap
* may lead to the function not terminating.
*
* \param list A list.
* \return Reversed list or enc_sym(SYM_MERROR) if heap is full.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
lbm_value lbm_list_copy(lbm_value list);
/** A destructive append of two lists
*
* \param list1 A list
* \param list2 A list
* \return list1 with list2 appended at the end.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
lbm_value lbm_list_append(lbm_value list1, lbm_value list2);
// State and statistics
/** Get a copy of the heap statistics structure.
*
* \param A pointer to an lbm_heap_state_t to populate
* with the current statistics.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
void lbm_get_heap_state(lbm_heap_state_t *);
// Garbage collection
/** Increment the counter that is counting the number of times GC ran
*
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
void lbm_gc_state_inc(void);
/** Mark all heap cells that are on the free-list.
*
* \return 1 on success or 0 if the free-list is corrupted.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
int lbm_gc_mark_freelist(void);
/** Mark heap cells reachable from the lbm_value v.
*
* \param v Root node to start marking from.
* \return 1 on success and 0 if the stack used internally is full.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
int lbm_gc_mark_phase(lbm_value v);
int lbm_gc_mark_phase2(lbm_value env);
/** Performs lbm_gc_mark_phase on all the values of an array.
*
* \param data Array of roots to traverse from.
* \param n Number of elements in roots-array.
* \return 1 on success or 0 for failure.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
int lbm_gc_mark_aux(lbm_uint *data, lbm_uint n);
/** Sweep up all non marked heap cells and place them on the free list.
*
* \return 1
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
int lbm_gc_sweep_phase(void);
// Array functionality
/** Allocate an array in symbols and arrays memory (lispbm_memory.h)
* and create a heap cell that refers to this array.
* \param res The resulting lbm_value is returned through this argument.
* \param size Array size in number of 32 bit words.
* \param type The type information to encode onto the heap cell.
* \return 1 for success of 0 for failure.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
int lbm_heap_allocate_array(lbm_value *res, lbm_uint size, lbm_type type);
/** Explicitly free an array.
* This function needs to be used with care and knowledge.
* \param arr Array value.
*/
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
int lbm_heap_explicit_free_array(lbm_value arr);
/** Query the type information of a value.
*
* \param x Value to check the type of.
* \return The type information.
*/
static inline lbm_type lbm_type_of(lbm_value x) {
return (x & LBM_PTR_MASK) ? (x & LBM_PTR_TYPE_MASK) : (x & LBM_VAL_TYPE_MASK);
}
static inline lbm_value lbm_enc_cons_ptr(lbm_uint x) {
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
return ((x << LBM_ADDRESS_SHIFT) | LBM_TYPE_CONS | LBM_PTR_BIT);
}
static inline lbm_uint lbm_dec_ptr(lbm_value p) {
return ((LBM_PTR_VAL_MASK & p) >> LBM_ADDRESS_SHIFT);
}
static inline lbm_value lbm_set_ptr_type(lbm_value p, lbm_type t) {
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
return ((LBM_PTR_VAL_MASK & p) | t | LBM_PTR_BIT);
}
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
static inline lbm_value lbm_enc_sym(lbm_uint s) {
return (s << LBM_VAL_SHIFT) | LBM_TYPE_SYMBOL;
}
static inline lbm_value lbm_enc_i(lbm_int x) {
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
return ((lbm_uint)x << LBM_VAL_SHIFT) | LBM_TYPE_I;
}
static inline lbm_value lbm_enc_u(lbm_uint x) {
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
return (x << LBM_VAL_SHIFT) | LBM_TYPE_U;
}
static inline lbm_value lbm_enc_i32(int32_t x) {
#ifndef LBM64
lbm_value i = lbm_cons((lbm_uint)x, lbm_enc_sym(SYM_RAW_I_TYPE));
if (lbm_type_of(i) == LBM_TYPE_SYMBOL) return i;
return lbm_set_ptr_type(i, LBM_TYPE_I32);
#else
return (((lbm_uint)x) << LBM_VAL_SHIFT) | LBM_TYPE_I32;
#endif
}
static inline lbm_value lbm_enc_u32(uint32_t x) {
#ifndef LBM64
lbm_value u = lbm_cons(x, lbm_enc_sym(SYM_RAW_U_TYPE));
if (lbm_type_of(u) == LBM_TYPE_SYMBOL) return u;
return lbm_set_ptr_type(u, LBM_TYPE_U32);
#else
return (((lbm_uint)x) << LBM_VAL_SHIFT) | LBM_TYPE_U32;
#endif
}
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
static inline lbm_value lbm_enc_float(float x) {
#ifndef LBM64
lbm_uint t;
memcpy(&t, &x, sizeof(lbm_float));
lbm_value f = lbm_cons(t, lbm_enc_sym(SYM_RAW_F_TYPE));
if (lbm_type_of(f) == LBM_TYPE_SYMBOL) return f;
return lbm_set_ptr_type(f, LBM_TYPE_FLOAT);
#else
uint32_t t;
memcpy(&t, &x, sizeof(float)); /*TODO: Assumes something about storage here ?*/
return (((lbm_uint)t) << LBM_VAL_SHIFT) | LBM_TYPE_FLOAT;
#endif
}
static inline lbm_value lbm_enc_i64(int64_t x) {
#ifndef LBM64
lbm_value res = lbm_enc_sym(SYM_MERROR);
lbm_uint* storage = lbm_memory_allocate(2);
if (storage) {
res = lbm_cons((lbm_uint)storage, lbm_enc_sym(SYM_IND_I_TYPE));
if (lbm_type_of(res) != LBM_TYPE_SYMBOL) {
memcpy(storage,&x, 8);
res = lbm_set_ptr_type(res, LBM_TYPE_I64);
}
}
return res;
#else
lbm_value u = lbm_cons((uint64_t)x, lbm_enc_sym(SYM_RAW_I_TYPE));
if (lbm_type_of(u) == LBM_TYPE_SYMBOL) return u;
return lbm_set_ptr_type(u, LBM_TYPE_I64);
#endif
}
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
static inline lbm_value lbm_enc_u64(uint64_t x) {
#ifndef LBM64
lbm_value res = lbm_enc_sym(SYM_MERROR);
lbm_uint* storage = lbm_memory_allocate(2);
if (storage) {
res = lbm_cons((lbm_uint)storage, lbm_enc_sym(SYM_IND_U_TYPE));
if (lbm_type_of(res) != LBM_TYPE_SYMBOL) {
memcpy(storage,&x, 8);
res = lbm_set_ptr_type(res, LBM_TYPE_U64);
}
}
return res;
#else
lbm_value u = lbm_cons(x, lbm_enc_sym(SYM_RAW_U_TYPE));
if (lbm_type_of(u) == LBM_TYPE_SYMBOL) return u;
return lbm_set_ptr_type(u, LBM_TYPE_U64);
#endif
}
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
static inline lbm_value lbm_enc_double(double x) {
#ifndef LBM64
lbm_value res = lbm_enc_sym(SYM_MERROR);
lbm_uint* storage = lbm_memory_allocate(2);
if (storage) {
res = lbm_cons((lbm_uint)storage, lbm_enc_sym(SYM_IND_F_TYPE));
if (lbm_type_of(res) != LBM_TYPE_SYMBOL) {
memcpy(storage,&x, 8);
res = lbm_set_ptr_type(res, LBM_TYPE_DOUBLE);
}
}
return res;
#else
lbm_uint t;
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
memcpy(&t, &x, sizeof(lbm_float));
lbm_value f = lbm_cons(t, lbm_enc_sym(SYM_RAW_F_TYPE));
if (lbm_type_of(f) == LBM_TYPE_SYMBOL) return f;
return lbm_set_ptr_type(f, LBM_TYPE_DOUBLE);
#endif
}
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
static inline lbm_value lbm_enc_char(char x) {
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
return ((lbm_uint)x << LBM_VAL_SHIFT) | LBM_TYPE_CHAR;
}
static inline lbm_int lbm_dec_i(lbm_value x) {
return (lbm_int)x >> LBM_VAL_SHIFT;
}
static inline lbm_uint lbm_dec_u(lbm_value x) {
return x >> LBM_VAL_SHIFT;
}
static inline char lbm_dec_char(lbm_value x) {
return (char)(x >> LBM_VAL_SHIFT);
}
static inline lbm_uint lbm_dec_sym(lbm_value x) {
return x >> LBM_VAL_SHIFT;
}
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
static inline float lbm_dec_float(lbm_value x) {
#ifndef LBM64
float f_tmp;
lbm_uint tmp = lbm_car(x);
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
memcpy(&f_tmp, &tmp, sizeof(float));
return f_tmp;
#else
uint32_t tmp = (uint32_t)(x >> LBM_VAL_SHIFT);
float f_tmp;
memcpy(&f_tmp, &tmp, sizeof(float));
return f_tmp;
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
#endif
}
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
static inline double lbm_dec_double(lbm_value x) {
#ifndef LBM64
double d;
uint32_t *data = (uint32_t*)lbm_car(x);
memcpy(&d, data, sizeof(double));
return d;
#else
double f_tmp;
lbm_uint tmp = lbm_car(x);
memcpy(&f_tmp, &tmp, sizeof(double));
return f_tmp;
#endif
}
static inline uint32_t lbm_dec_u32(lbm_value x) {
#ifndef LBM64
return (uint32_t)lbm_car(x);
#else
return (uint32_t)(x >> LBM_VAL_SHIFT);
#endif
}
static inline uint64_t lbm_dec_u64(lbm_value x) {
#ifndef LBM64
uint64_t u;
uint32_t *data = (uint32_t*)lbm_car(x);
memcpy(&u, data, 8);
return u;
#else
return (uint64_t)lbm_car(x);
#endif
}
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
static inline int32_t lbm_dec_i32(lbm_value x) {
#ifndef LBM64
return (int32_t)lbm_car(x);
#else
return (int32_t)(x >> LBM_VAL_SHIFT);
#endif
}
static inline int64_t lbm_dec_i64(lbm_value x) {
#ifndef LBM64
int64_t i;
uint32_t *data = (uint32_t*)lbm_car(x);
memcpy(&i, data, 8);
return i;
#else
return (int64_t)lbm_car(x);
#endif
}
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
static inline lbm_value lbm_set_gc_mark(lbm_value x) {
return x | LBM_GC_MARKED;
}
static inline lbm_value lbm_clr_gc_mark(lbm_value x) {
return x & ~LBM_GC_MASK;
}
static inline bool lbm_get_gc_mark(lbm_value x) {
return x & LBM_GC_MASK;
}
static inline bool lbm_is_ptr(lbm_value x) {
return (x & LBM_PTR_MASK);
}
static inline bool lbm_is_list(lbm_value x) {
return (lbm_type_of(x) == LBM_TYPE_CONS);
}
static inline bool lbm_is_number(lbm_value x) {
lbm_uint t = lbm_type_of(x);
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
return ((t == LBM_TYPE_I) ||
(t == LBM_TYPE_U) ||
(t == LBM_TYPE_CHAR) ||
(t == LBM_TYPE_I32) ||
(t == LBM_TYPE_U32) ||
(t == LBM_TYPE_I64) ||
(t == LBM_TYPE_U64) ||
(t == LBM_TYPE_FLOAT) ||
(t == LBM_TYPE_DOUBLE));
}
static inline bool lbm_is_array(lbm_value x) {
return (lbm_type_of(x) == LBM_TYPE_ARRAY &&
lbm_type_of(lbm_cdr(x)) == LBM_TYPE_SYMBOL &&
lbm_dec_sym(lbm_cdr(x)) == SYM_ARRAY_TYPE);
}
static inline bool lbm_is_channel(lbm_value x) {
return (lbm_type_of(x) == LBM_TYPE_CHANNEL &&
lbm_type_of(lbm_cdr(x)) == LBM_TYPE_SYMBOL &&
lbm_dec_sym(lbm_cdr(x)) == SYM_CHANNEL_TYPE);
}
static inline bool lbm_is_char(lbm_value x) {
lbm_uint t = lbm_type_of(x);
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
return (t == LBM_TYPE_CHAR);
}
static inline bool lbm_is_special(lbm_value symrep) {
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
return ((lbm_type_of(symrep) == LBM_TYPE_SYMBOL) &&
(lbm_dec_sym(symrep) < SPECIAL_SYMBOLS_END));
}
static inline bool lbm_is_fundamental(lbm_value symrep) {
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
return ((lbm_type_of(symrep) == LBM_TYPE_SYMBOL) &&
(lbm_dec_sym(symrep) >= FUNDAMENTALS_START) &&
(lbm_dec_sym(symrep) <= FUNDAMENTALS_END));
}
static inline bool lbm_is_closure(lbm_value exp) {
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
return ((lbm_type_of(exp) == LBM_TYPE_CONS) &&
(lbm_type_of(lbm_car(exp)) == LBM_TYPE_SYMBOL) &&
(lbm_dec_sym(lbm_car(exp)) == SYM_CLOSURE));
}
Squashed 'lispBM/lispBM/' changes from 6a219e20..7930b985 7930b985 tweak change log e8869883 small amounts of optimization to eval_cps ac3bd152 silly call-cc test 8dba90e3 Merge branch 'master' into dev f4cf6a54 added one more test of array_extensions, packing and upacking floats b27895cb added test for hex numbers 337c0eda fix bug in compression that applies to hexadecimal numnbers. a55c5857 added another array_extensions test and fixed one bug d255d69b added another array_extensions test 983024d4 array creation from lisp and one test added 65d8a498 bug fix array_extensions 47ddb8ae updates to array_extensions cb5c3421 small tweaks to array-extensions, starting to maybe make sense 01233e92 some small additions to array_extensions fb9db7ab mini-tweak array_extensions a05aa268 fix bugs in lispbm.mk and add a test of variables2 ddca1665 small tweaks array-extensions 2466abc6 work in progress 0dc7ec7c work in progress with a library of array extensions df142ceb added .clang_complete 5229ca5e planning, no code yet cd6f5e3f Merge branch 'master' into dev 0f4c9bf2 added a rule for running tests from the makefile and tweaks test-script to only fail if there are unexpected failures 7a61f4e1 Merge branch 'master' into dev 9f8c9caf update lbm_version feab23d3 Merge branch 'master' into dev 112c01df added array creation from C on the lbm_memory. GC will remove these ca70c70a Merge branch 'master' into dev f8e38cc2 Merge branch 'master' into dev fc203669 Merge branch 'master' into dev 57af7182 Merge branch 'master' into dev 037e2352 commenting and version 977cd92a Merge branch 'master' into dev 34322bcf small tweak readme 1f22da9e fix recursion issue with macros fec81a7b version tweak 8548884b macros and callcc 7eadf3cc added a macro test2 8152930d improvement to macro subsystem cce45228 first sketch of macro expansion git-subtree-dir: lispBM/lispBM git-subtree-split: 7930b9854a05a8d09b40d078da94bb3743ef977b
2022-02-21 03:02:15 -08:00
static inline bool lbm_is_continuation(lbm_value exp) {
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
return ((lbm_type_of(exp) == LBM_TYPE_CONS) &&
(lbm_type_of(lbm_car(exp)) == LBM_TYPE_SYMBOL) &&
Squashed 'lispBM/lispBM/' changes from 6a219e20..7930b985 7930b985 tweak change log e8869883 small amounts of optimization to eval_cps ac3bd152 silly call-cc test 8dba90e3 Merge branch 'master' into dev f4cf6a54 added one more test of array_extensions, packing and upacking floats b27895cb added test for hex numbers 337c0eda fix bug in compression that applies to hexadecimal numnbers. a55c5857 added another array_extensions test and fixed one bug d255d69b added another array_extensions test 983024d4 array creation from lisp and one test added 65d8a498 bug fix array_extensions 47ddb8ae updates to array_extensions cb5c3421 small tweaks to array-extensions, starting to maybe make sense 01233e92 some small additions to array_extensions fb9db7ab mini-tweak array_extensions a05aa268 fix bugs in lispbm.mk and add a test of variables2 ddca1665 small tweaks array-extensions 2466abc6 work in progress 0dc7ec7c work in progress with a library of array extensions df142ceb added .clang_complete 5229ca5e planning, no code yet cd6f5e3f Merge branch 'master' into dev 0f4c9bf2 added a rule for running tests from the makefile and tweaks test-script to only fail if there are unexpected failures 7a61f4e1 Merge branch 'master' into dev 9f8c9caf update lbm_version feab23d3 Merge branch 'master' into dev 112c01df added array creation from C on the lbm_memory. GC will remove these ca70c70a Merge branch 'master' into dev f8e38cc2 Merge branch 'master' into dev fc203669 Merge branch 'master' into dev 57af7182 Merge branch 'master' into dev 037e2352 commenting and version 977cd92a Merge branch 'master' into dev 34322bcf small tweak readme 1f22da9e fix recursion issue with macros fec81a7b version tweak 8548884b macros and callcc 7eadf3cc added a macro test2 8152930d improvement to macro subsystem cce45228 first sketch of macro expansion git-subtree-dir: lispBM/lispBM git-subtree-split: 7930b9854a05a8d09b40d078da94bb3743ef977b
2022-02-21 03:02:15 -08:00
(lbm_dec_sym(lbm_car(exp)) == SYM_CONT));
}
static inline bool lbm_is_macro(lbm_value exp) {
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
return ((lbm_type_of(exp) == LBM_TYPE_CONS) &&
(lbm_type_of(lbm_car(exp)) == LBM_TYPE_SYMBOL) &&
Squashed 'lispBM/lispBM/' changes from 6a219e20..7930b985 7930b985 tweak change log e8869883 small amounts of optimization to eval_cps ac3bd152 silly call-cc test 8dba90e3 Merge branch 'master' into dev f4cf6a54 added one more test of array_extensions, packing and upacking floats b27895cb added test for hex numbers 337c0eda fix bug in compression that applies to hexadecimal numnbers. a55c5857 added another array_extensions test and fixed one bug d255d69b added another array_extensions test 983024d4 array creation from lisp and one test added 65d8a498 bug fix array_extensions 47ddb8ae updates to array_extensions cb5c3421 small tweaks to array-extensions, starting to maybe make sense 01233e92 some small additions to array_extensions fb9db7ab mini-tweak array_extensions a05aa268 fix bugs in lispbm.mk and add a test of variables2 ddca1665 small tweaks array-extensions 2466abc6 work in progress 0dc7ec7c work in progress with a library of array extensions df142ceb added .clang_complete 5229ca5e planning, no code yet cd6f5e3f Merge branch 'master' into dev 0f4c9bf2 added a rule for running tests from the makefile and tweaks test-script to only fail if there are unexpected failures 7a61f4e1 Merge branch 'master' into dev 9f8c9caf update lbm_version feab23d3 Merge branch 'master' into dev 112c01df added array creation from C on the lbm_memory. GC will remove these ca70c70a Merge branch 'master' into dev f8e38cc2 Merge branch 'master' into dev fc203669 Merge branch 'master' into dev 57af7182 Merge branch 'master' into dev 037e2352 commenting and version 977cd92a Merge branch 'master' into dev 34322bcf small tweak readme 1f22da9e fix recursion issue with macros fec81a7b version tweak 8548884b macros and callcc 7eadf3cc added a macro test2 8152930d improvement to macro subsystem cce45228 first sketch of macro expansion git-subtree-dir: lispBM/lispBM git-subtree-split: 7930b9854a05a8d09b40d078da94bb3743ef977b
2022-02-21 03:02:15 -08:00
(lbm_dec_sym(lbm_car(exp)) == SYM_MACRO));
}
static inline bool lbm_is_match_binder(lbm_value exp) {
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
return ((lbm_type_of(exp) == LBM_TYPE_CONS) &&
(lbm_type_of(lbm_car(exp)) == LBM_TYPE_SYMBOL) &&
((lbm_dec_sym(lbm_car(exp)) == SYM_MATCH_ANY) ||
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
(lbm_dec_sym(lbm_car(exp)) == SYM_MATCH_I) ||
(lbm_dec_sym(lbm_car(exp)) == SYM_MATCH_U) ||
(lbm_dec_sym(lbm_car(exp)) == SYM_MATCH_I32) ||
(lbm_dec_sym(lbm_car(exp)) == SYM_MATCH_U32) ||
(lbm_dec_sym(lbm_car(exp)) == SYM_MATCH_FLOAT) ||
(lbm_dec_sym(lbm_car(exp)) == SYM_MATCH_I64) ||
(lbm_dec_sym(lbm_car(exp)) == SYM_MATCH_U64) ||
(lbm_dec_sym(lbm_car(exp)) == SYM_MATCH_DOUBLE) ||
(lbm_dec_sym(lbm_car(exp)) == SYM_MATCH_CONS)));
}
static inline bool lbm_is_comma_qualified_symbol(lbm_value exp) {
return (lbm_is_list(exp) &&
(lbm_type_of(lbm_car(exp)) == LBM_TYPE_SYMBOL) &&
(lbm_dec_sym(lbm_car(exp)) == SYM_COMMA) &&
(lbm_type_of(lbm_car(lbm_cdr(exp))) == LBM_TYPE_SYMBOL));
}
static inline bool lbm_is_symbol(lbm_value exp) {
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
return (lbm_type_of(exp) == LBM_TYPE_SYMBOL);
}
static inline bool lbm_is_symbol_nil(lbm_value exp) {
return (lbm_is_symbol(exp) && lbm_dec_sym(exp) == SYM_NIL);
}
static inline bool lbm_is_symbol_eval(lbm_value exp) {
return (lbm_is_symbol(exp) && lbm_dec_sym(exp) == SYM_EVAL);
}
static inline bool lbm_is_symbol_merror(lbm_value exp) {
return (lbm_is_symbol(exp) && lbm_dec_sym(exp) == SYM_MERROR);
}
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
#ifndef LBM64
#define ERROR_SYMBOL_MASK 0xFFFFFF20
#else
#define ERROR_SYMBOL_MASK 0xFFFFFFFFFFFFFF20
#endif
/* all error signaling symbols are in the range 0x20 - 0x2F */
static inline bool lbm_is_error(lbm_value v){
Squashed 'lispBM/lispBM/' changes from 6199703d..43ebce71 43ebce71 Fix formatting int print.c and constants that default to float/double fa220f0b update gc statistics collection a small bit 25b20686 fix get_heap_state 783d774e Arrays of 64bit values passes the associated tests. More tests are needed though ff40d02f working on 64bit arrays. more testing needed 204bea39 CMP as a macro instead of 8 different functions 44bb152d added a set of math extensions grabbed from Benjamin's bldc repo 9c34b4cd added string extensions from benjamins bldc repo b4370155 merge in changes on master into dev64bit c129344b fixed masking bug in fundamentals ed3ab5be closed down ome warnings when building 64bit d46564c9 expanded functionality of type-of to cover 64bit types and preparations for arrays of 64bit values f7cb5538 added more 64bit functionality to fundamentals and a tiny amount of tests 4dafbe6c added decoders for 64bit values 63026a8a added 64bit value literals 8c1f0f0f made GC aware of lbm_memory allocated values 17148ada 64 bit values allocated on lbm_memory on 32 bit version 4445e5a8 sketch of encoders for 64 bit values f636e64d suffix for the lisp size of int and uint are now i and u instead of i28 and u28 840723ca preparations and planning for 64bit types in both 32 and 64 bit versions. 13675dda 64bit up and running. but there are many TODOs 033bfd9a small fixes following bug hunt f5c984de fix bug in representation of important masks and constants d40b2437 Merge branch 'master' into dev64bit 06f9603f Merge branch 'master' into dev64bit 69950ba1 32 bit tests are ok 46b6fa28 Merge branch 'master' into dev64bit b9e2c993 work in progress 8dff9b4d work in progress a241aded work in progress 4738e0da update year in lbm_types ca469923 made it possible to run the same tests as on the 32 bit version on the 64 bit code 85acec30 small tweaks tp create_ctx, use correct type bf0286a7 Merge branch 'master' into dev64bit 824e1634 Merge branch 'master' into dev64bit 04a97f17 lots of testing needed ea862cce a bunch of changes in preparation for 64bit compatibility. git-subtree-dir: lispBM/lispBM git-subtree-split: 43ebce71a281f4a158b8d2dec3fc537c26766ec3
2022-03-25 07:47:05 -07:00
if (lbm_type_of(v) == LBM_TYPE_SYMBOL &&
((lbm_dec_sym(v) & ERROR_SYMBOL_MASK) == 0x20)) {
return true;
}
return false;
}
Squashed 'lispBM/lispBM/' changes from ccca9778..db80cb7d db80cb7d updates to how symbols are evaluated, mostly for readability but also efficiency bb573b53 slight optimizations to mark_phase and mark_freelist 58242f41 tweaking the manual 51666fb5 update manual fix prelude situation 2c6349da work on manual 39a15fd8 update a5310055 added a bit more text about symbols in the manual 60d59eec added a bit more text about symbols in the manual f685819e added a bit more text about symbols in the manual 31d56d35 added a bit more text about symbols in the manual 54796c35 added a bit more text about symbols in the manual e333c00f Small readability and efficiency tweaks to eval_cps 0d234b5e lbm_cadr added and sligth modifications to eval_cps.c using lbm_cadr 85cd864a update changelog 6d2c8685 work on manual 5203a64f work on manual 63ebbae2 work on manual 4a146954 work on manual 19a0d06f work on manual 91c1d992 work on manual ab393f46 work on manual 26309199 work on manual c474931b work on manual 1a822e8d work on manual 648f6433 work on manual 6737828a work on manual 2d8e7084 work on manual 3a834fce work on manual 7ae1b342 work on manual bc5b1fd0 work on manual d3b6ec4d work on manual 654d70f8 writing on the manual 0d66dda6 tweak readme d846ea3b update README 2c18d1a6 small tweak bd9f80e5 allowing more characters in symbols 61827fc2 remove the prelude library in its current form. It is still available in the REPL f1dcea8f small tweak benchmarking code 3a761cee update manual e9898b19 make the prelude functions load dynamically when needed by the repl and test-system 714be360 update manual e1804e3e update lbmref, renamings 508d167c Update README.md 6f3207fa Update ch1_introduction.md 6562daef Update ch1_introduction.md 76b48adf work in progress proramming doc 91c44751 fix repl-cps makefile to correctly build deps 54e66b25 remove lbmref.dox f0c90ffd update reference manual 5b577572 fix potential bug in cont_application_start git-subtree-dir: lispBM/lispBM git-subtree-split: db80cb7dd05eef9e71980a55ff7987118c32c6e9
2022-04-12 01:44:49 -07:00
// ref_cell: returns a reference to the cell addressed by bits 3 - 26
// Assumes user has checked that is_ptr was set
static inline lbm_cons_t* lbm_ref_cell(lbm_value addr) {
return &lbm_heap_state.heap[lbm_dec_ptr(addr)];
Squashed 'lispBM/lispBM/' changes from ccca9778..db80cb7d db80cb7d updates to how symbols are evaluated, mostly for readability but also efficiency bb573b53 slight optimizations to mark_phase and mark_freelist 58242f41 tweaking the manual 51666fb5 update manual fix prelude situation 2c6349da work on manual 39a15fd8 update a5310055 added a bit more text about symbols in the manual 60d59eec added a bit more text about symbols in the manual f685819e added a bit more text about symbols in the manual 31d56d35 added a bit more text about symbols in the manual 54796c35 added a bit more text about symbols in the manual e333c00f Small readability and efficiency tweaks to eval_cps 0d234b5e lbm_cadr added and sligth modifications to eval_cps.c using lbm_cadr 85cd864a update changelog 6d2c8685 work on manual 5203a64f work on manual 63ebbae2 work on manual 4a146954 work on manual 19a0d06f work on manual 91c1d992 work on manual ab393f46 work on manual 26309199 work on manual c474931b work on manual 1a822e8d work on manual 648f6433 work on manual 6737828a work on manual 2d8e7084 work on manual 3a834fce work on manual 7ae1b342 work on manual bc5b1fd0 work on manual d3b6ec4d work on manual 654d70f8 writing on the manual 0d66dda6 tweak readme d846ea3b update README 2c18d1a6 small tweak bd9f80e5 allowing more characters in symbols 61827fc2 remove the prelude library in its current form. It is still available in the REPL f1dcea8f small tweak benchmarking code 3a761cee update manual e9898b19 make the prelude functions load dynamically when needed by the repl and test-system 714be360 update manual e1804e3e update lbmref, renamings 508d167c Update README.md 6f3207fa Update ch1_introduction.md 6562daef Update ch1_introduction.md 76b48adf work in progress proramming doc 91c44751 fix repl-cps makefile to correctly build deps 54e66b25 remove lbmref.dox f0c90ffd update reference manual 5b577572 fix potential bug in cont_application_start git-subtree-dir: lispBM/lispBM git-subtree-split: db80cb7dd05eef9e71980a55ff7987118c32c6e9
2022-04-12 01:44:49 -07:00
// return (cons_t*)(heap_base + (addr & PTR_VAL_MASK));
}
Squashed 'lispBM/lispBM/' changes from 6f442405..28c56c43 28c56c43 Update README.md d975e8b6 update readme 9e0bbcba update readme ad38f2d0 updated readme with a note about switch of scheduler 756f2d71 Round-robin scheduling quota can be set from the C code 45edcd9d update: fix typo dade6935 Added atomic operator 4ff6665a Mostly ok round robin scheduling at this point I think. a6af047a experimentation and planning e69d36e7 fair round robin scheduler running but slow 3a0e6905 Merge branch 'master' into sched0 2784f8e5 bugfix symrepr.c c464a78e work in progress 207a0b92 Merge branch 'master' into sched0 a916a1af experimentation and preparations b9565fbb broke out a bunch of useful definitions into an lbm_defines.h file 1fb91025 update to platform_uart for chibios 16640653 additions to chibios platform uart and some additions to string extensions 6bfbb376 added array-clear 8e2bc4a3 Improvements to revamped reader 84ff5198 Considerable rewamping of the reader - passes all tests but there are some issues to resolve bfdf352f minor tweak f33fde26 Modifications to uart stream in platform chibios 571a1382 low-level character stream from a uart. This has some problems! 2f49efe9 Experimentation streams 4437c69e tweaks to platform uart dd181414 fix typo in platform_uart.c for chibios 5b9ae388 chibios repl uart tested and seems ok 49409772 untested uart extensions in chibios repl af5d03d8 untested uart implementation for chibios repl 5bde526b added one more test case for conditionals dceb4d26 added some new tests 0f477d09 pedantry dc5b08d9 Some pedantic tweaks to close some jump-misses-init warnings c5aff865 A pass to make static analysis happy 0bdd23c3 update 12a93acc update ch3 with some small tweaks ac881933 added more text to chapter3 about concurrency and message passing d8589b75 update 59229152 update 85ef5a79 update lbmref description of namespace 4fd7e48f added information about namespace to lbmref b93cd379 added some tests of namespaces and updated the compressor to allow the : character 48a99c13 Merge branch 'master' of github.com:svenssonjoel/lispbm 8f019213 updated behaviour of lbm_define related to #variables and the addition of simplistic namespaces 1d824a4e Update ch3_concurrency.md dcb2ef38 wip a0d5971d work in progress 4c9818c6 typo 06fbaac7 work in progress ch3 26a466e0 chapter 3 in progress f376ae8e ch3 concurrency in progress d1399247 added some images to manual ch2 ac813050 fix bug that surfaces if no dynamic load callback is present git-subtree-dir: lispBM/lispBM git-subtree-split: 28c56c436d3cb621a775bb648d60660563c5352e
2022-09-04 07:08:58 -07:00
#ifdef __cplusplus
}
#endif
#endif