bldc/include/lbm_memory.h

166 lines
6.0 KiB
C
Raw Normal View History

/** \file lbm_memory.h */
/*
Copyright 2020, 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/>.
*/
/*
Motivation: Memory manager for allocation of strings and arrays
that will not be be located on the lisp-heap. These kinds of values
have thus far been allocated using the "malloc" function provided
on the platform. Using malloc is something I want to move away from
doing within the guts of lispBM as I want it to be possible on
running on the bare metal.
** This is already done!
Later perhaps things such as the symbol table with symbol mappings
should also be located on this managed memory area. Symbols,
however, are never freed after being created in lispBM. Currently I
dont know if that is a good idea? or if it is possible to free
unused symbols at all. To become entirely free from malloc, the entire
symbol table management must be rewritten.
*/
/*
Notes:
64Bytes = 16 * 4Byte words
4Bytes = 32Bits = 16 * 2Bit of status
Status Bitpatterns:
00 - FREE or USED 4Byte word
01 - END of a sequence of allocated words
10 - START of a sequence of allocated words
11 - START and END of a sequence of allocated words (a 1 word allocation)
0 1 2 3 4 5 6 7 8 9
[11 00 00 00 00 10 01 11 00 00]
Favours allocation of small amounts of data.
Requirements:
- Memory space is a multiple of 64Bytes.
- Memory status bitmap is the same multiple of 4Bytes.
Number of bits in an offset from the base_address
MEMORY_SIZE_512 => 9
MEMORY_SIZE_1K => 10
MEMORY_SIZE_2K => 11
MEMORY_SIZE_1M => 20
MEMORY_SIZE_16M => 24
MEMORY_SIZE_32M => 25
MEMORY_SIZE_64M => 26
MEMORY_SIZE_128M => 27
MEMORY_SIZE_256M => 28
However, due to alignment on a address multiple of 4, the 2 least
significant bits are zeroes. So an offset into memory of size up to
1GB should be possible to represent within a lispBM VALUE. This that
using the offset into memory could be used as the identity of a
symbol when it comes to replacing the symbol table.
*/
#ifndef _LISPBM_MEMORY_H_
#define _LISPBM_MEMORY_H_
#include "lbm_types.h"
#include <stdint.h>
#define LBM_MEMORY_SIZE_64BYTES_TIMES_X(X) (16*(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
#ifndef LBM64
#define LBM_MEMORY_BITMAP_SIZE(X) (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
#else
#define LBM_MEMORY_BITMAP_SIZE(X) ((X)/2)
#endif
#define LBM_MEMORY_SIZE_512 LBM_MEMORY_SIZE_64BYTES_TIMES_X(8)
#define LBM_MEMORY_SIZE_1K LBM_MEMORY_SIZE_64BYTES_TIMES_X(16)
#define LBM_MEMORY_SIZE_2K LBM_MEMORY_SIZE_64BYTES_TIMES_X(32)
#define LBM_MEMORY_SIZE_4K LBM_MEMORY_SIZE_64BYTES_TIMES_X(64)
#define LBM_MEMORY_SIZE_8K LBM_MEMORY_SIZE_64BYTES_TIMES_X(128)
#define LBM_MEMORY_SIZE_10K LBM_MEMORY_SIZE_64BYTES_TIMES_X(160)
#define LBM_MEMORY_SIZE_12K LBM_MEMORY_SIZE_64BYTES_TIMES_X(192)
#define LBM_MEMORY_SIZE_14K LBM_MEMORY_SIZE_64BYTES_TIMES_X(224)
#define LBM_MEMORY_SIZE_16K LBM_MEMORY_SIZE_64BYTES_TIMES_X(256)
#define LBM_MEMORY_SIZE_32K LBM_MEMORY_SIZE_64BYTES_TIMES_X(512)
#define LBM_MEMORY_SIZE_1M LBM_MEMORY_SIZE_64BYTES_TIMES_X(16384)
#define LBM_MEMORY_BITMAP_SIZE_512 LBM_MEMORY_BITMAP_SIZE(8)
#define LBM_MEMORY_BITMAP_SIZE_1K LBM_MEMORY_BITMAP_SIZE(16)
#define LBM_MEMORY_BITMAP_SIZE_2K LBM_MEMORY_BITMAP_SIZE(32)
#define LBM_MEMORY_BITMAP_SIZE_4K LBM_MEMORY_BITMAP_SIZE(64)
#define LBM_MEMORY_BITMAP_SIZE_8K LBM_MEMORY_BITMAP_SIZE(128)
#define LBM_MEMORY_BITMAP_SIZE_10K LBM_MEMORY_BITMAP_SIZE(160)
#define LBM_MEMORY_BITMAP_SIZE_12K LBM_MEMORY_BITMAP_SIZE(192)
#define LBM_MEMORY_BITMAP_SIZE_14K LBM_MEMORY_BITMAP_SIZE(224)
#define LBM_MEMORY_BITMAP_SIZE_16K LBM_MEMORY_BITMAP_SIZE(256)
#define LBM_MEMORY_BITMAP_SIZE_32K LBM_MEMORY_BITMAP_SIZE(512)
#define LBM_MEMORY_BITMAP_SIZE_1M LBM_MEMORY_BITMAP_SIZE(16384)
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
/** Initialize the symbols and arrays memory
*
* \param data Pointer to an array of uint32_t for data storage.
* \param data_size The size of the data storage array in number of uint32_t elements.
* \param bitmap Pointer to an array of uint32_t for memory allocator meta-data.
* \param bitmap_size The size of the meta-data in number of uint32_t elements.
* \return
*/
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
extern int lbm_memory_init(lbm_uint *data, lbm_uint data_size,
lbm_uint *bitmap, lbm_uint bitmap_size);
/** Size of of the symbols and arrays memory in uint32_t chunks.
*
* \return Numberof uint32_t words.
*/
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
extern lbm_uint lbm_memory_num_words(void);
/**
*
* \return The number of free words in the symbols and arrays memory.
*/
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
extern lbm_uint lbm_memory_num_free(void);
/** Find the length of the longest run of consecutire free indices
* in the LBM memory.
*/
extern lbm_uint lbm_memory_longest_free(void);
/** Allocate a number of words from the symbols and arrays memory.
*
* \param num_words Number of words to allocate.
* \return pointer to allocated array or NULL.
*/
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
extern lbm_uint *lbm_memory_allocate(lbm_uint num_words);
/** Free an allocated array int the symbols and arrays memory.
*
* \param ptr Pointer to array to free.
* \return 1 on success and 0 on failure.
*/
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
extern int lbm_memory_free(lbm_uint *ptr);
/** Shrink an allocated array.
* \param ptr Pointer to array to shrink
* \param n New smaller size of array
* \return 1 on success and 0 on failure.
*/
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
extern int lbm_memory_shrink(lbm_uint *ptr, lbm_uint n);
/** Check if a pointer points into the lbm_memory
*
* \param ptr
* \return 1 for yes and 0 for no.
*/
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
extern int lbm_memory_ptr_inside(lbm_uint *ptr);
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
extern lbm_int lbm_memory_address_to_ix(lbm_uint *ptr);
#endif