This uses the existing mechanism for statically compiled C libraries,
to allow the user to export their own C libraries in a similar way.
User exported libraries can be added on top of statically compiled C
libraries or exist on their own (by setting SEXP_USE_STATIC_LIBS_EMPTY).
This is lighter-weight than building a full index->cursor table for
the string, adding a constant two words to the memory required to
store a string, as opposed to one word for every n characters. The
cached cursor is used for any string-ref operation requesting an index
after the most-recently-requested index, making potentially quadratic
repeated string-ref procedures run in linear time. In theory, it could
also use a heuristic to speed up moving backwards through the string
when it thinks that moving the old cursor backwards would be faster
than starting again at the start of the string. In practice, my
logging of when the cached cursor is actually reused during the Chibi
compilation and startup process shows that the most common case of
moving backwards is going back to the start of the string anyway.
Benchmarks to follow.
Replace explicit recursion by heap allocations
in sexp_mark_one code.
This prevents crashes caused by stack overflow.
In particular, fixes issue #601.
As an optimization, allocate a fixed sized stack buffer first,
which should be enough for "normal" uses.
When that stack overflows, switch to heap.
Also, store "ranges" on the stack, instead of the actual sexp's,
using the fact that sexp's of a single parent are continous in memory.
This patch doesn't remove recursion on the context saves
because it didn't seem like they overflow in practice.
But changing that is simple having the stack interface.
On NetBSD systems the netbsd feature identifier was not actually
provided because the macro SEXP_NETBSD was defined twice and the
second value was 0.
On DragonFly systems the dragonfly feature identifier was not actually
provided because the macro SEXP_DRAGONFLY was defined twice and the
second value was 0. Also on DragonFly systems the darwin feature
identifier was incorrectly provided because SEXP_DARWIN had a value of
1 instead of 0.
Introduce SEXP_STATIC_LIBRARY to support static-library build on
Win32/Win64. On Win32, symbol visibility is enforced on DLL builds so we
need to dedicated ABI on static-library builds.
Try to fix win32 port. Now it runs both on Win32/Win64.
Win64 port currently depends on 128bits arithmetic thus it does not run on
MSVC.
Makefile now have EXCLUDE_POSIX_LIBS knob to exclude posix related library
from build.
Introduce msys PLATFORM for Makefile.detect to use MSYS's POSIX
emulation layer. It is intended for linking against MSYS tools; it is
not for embedding to Win32 applications.
- It is possible to define `strcasecmp` and
`strncasecmp` twice if `__MINGW32__` is defined.
However, the same definition is used if it's not.
Therefore, I just moved it inside of the "if-defined"
case. It removes the errors pertaining to that header.
- Additional compilation errors related to the filesystem
implementation and POSIX definitions of constants still
are brought up when compiling on Windows 10, MSYS2-mingw-w64
with gcc.