Commit graph

5 commits

Author SHA1 Message Date
Alex Shinn
368191918b Patch from Peter Michaux to allow reordering the heap struct
so the data pointer is not the last element.
2013-09-29 13:14:34 +09:00
Alex Shinn
bad54b143c printing debug output on OOM 2012-06-24 14:07:59 -07:00
Alex Shinn
a18deb68cc Optional code refactoring.
Chibi uses a lot of #if conditioned code so that configuration
management can be done entirely with the C preprocessor.

Originally this also involved conditional includes of .c files
from other source files.  The alterative, which this change
switches to, is to compile and link all files, and for uneeded
files conditionally eliminate their entire bodies so they compile
to empty object files.

Pros for conditionally including all code into one large file:

  * Don't need to declare most functions (keeps .h files small).
  * Can keep most functions static/inlined (keeps objects small).
  * Don't need to even distribute uneeded files with the default
    Makefile (e.g. can prune opt/* from dist for minimal builds).

Pros for linking multiple possibly empty files:

  * Extensions and third-party libs probably want the exported
    declarations anyway.
  * Static analysis tools work better (e.g. flymake on what previously
    was an included file).
  * Can build each file in parallel (i.e. make -j for faster builds).
  * Can build and link in just the changed files, instead of
    having to recompile the whole thing.

For Chibi these are all minor points - it will be small
regardless, and will build fast regardless - but the arguments
for splitting seem stronger.  Note the new shared lib is about
1k larger, but that can be trimmed down later.
2012-06-21 23:04:07 -07:00
Alex Shinn
855af6120b sexp_release_object fix from Ben Weaver - wasn't releasing
the first object in the list.
2012-06-14 22:37:10 +09:00
Alex Shinn
85a7efc003 automatically making sockets non-blocking on accept 2012-05-14 08:37:45 -04:00