Age | Commit message (Collapse) | Author | Files | Lines |
|
* module/web/server/http.scm (<http-server>, http-open)
(read-request!, write-request!, enqueue-write!, http-write): As in the
previous commit, add support for concurrent writes.
(http-read): Pop off keepalive ports in this, the main loop.
(http-close): Shut down writers appropriately.
|
|
* module/web/server/http.scm (<http-server>): Add fields for a reader
thread-pool, and some async queues that it operates on. Also, a flag,
http-threaded?.
(http-open): Add #:threaded? and #:read-workers kwargs. Create a
thread pool for reading if threads are available.
(read-request!): New function, factored out of http-read.
(enqueue-read!, http-read): Instead of reading the client directly,
enqueue a read. In the case where threads are not available, this
will call read-request! directly. read-request! takes care of adding
to the handle-queue. The read polling loop will pop items off the
handle-queue.
(seconds-from-now, async-queue-for-each): New helpers.
(http-write): Shut down the queues and threads, hopefully in a
nonblocking fashion.
|
|
* module/web/server/http.scm (make-waker, flush-wake-port): New
functions, to wake up a poll().
(http-open): Add a wakeup port to the poll set.
(http-read): Handle the wakeup port specially.
|
|
* module/ice-9/thread-pool.scm: New file.
* module/Makefile.am: Add to build.
|
|
* module/ice-9/async-queue.scm: New file.
* module/Makefile.am: Add it to the make file.
|
|
|
|
|
|
* module/web/http.scm (write-date): Fix serialization of Mar. Oops.
|
|
* module/web/request.scm (bad-request-printer): Fix printer to expect
args as a list.
|
|
Conflicts:
configure.ac
|
|
* module/web/request.scm (bad-request-printer): Add printer for these
exceptions.
|
|
* module/web/server/http.scm (bad-request, http-read): If an exception
is raised while reading a response, write out a 400 Bad Request
response before closing the port.
|
|
* module/web/http.scm (bad-header-component): Throw
'bad-header-component instead of 'bad-header.
(bad-header-printer, bad-header-component-printer): Add exception
printers.
|
|
* configure.ac:
* libguile/gc.c (GC_set_finalize_on_demand): Check for this function,
and shim if it isn't present.
|
|
* module/language/elisp/boot.el (random): New function.
|
|
* module/language/elisp/boot.el (send-string-to-terminal)
(read-from-minibuffer, prin1-to-string): New functions.
|
|
* module/language/elisp/boot.el (symbol-name, intern): New functions.
|
|
* module/language/elisp/boot.el (when, unless): New macros.
|
|
* module/language/elisp/boot.el (nreverse, assoc, assq, rplaca, rplacd)
(caar, cadr, cdar, cddr, dolist, stringp, string-equal, string=)
(substring, upcase, downcase, string-match, make-vector, mapc, aref)
(aset, concat): New functions.
|
|
* module/language/elisp/boot.el (integerp, wholenump): Call `integer?'
before `exact?' so that these predicates return nil for non-numbers
instead of signalling an error.
|
|
Conflicts:
configure.ac
libguile/finalizers.c
libguile/finalizers.h
libguile/gc.c
libguile/gc.h
libguile/inline.c
libguile/inline.h
libguile/ports.c
libguile/smob.c
libguile/smob.h
module/ice-9/deprecated.scm
module/ice-9/r4rs.scm
|
|
* libguile/finalizers.c: New excitement! We'll be running finalizers
asynchronously, from asyncs. This will make it safer to allocate
while holding a mutex.
(GC_set_finalizer_notifier): Add back-compat shim.
* libguile/init.c (scm_i_init_guile): Init the async finalizer mechanism
during boot.
* libguile/gc.c (scm_storage_prehistory): Tell libgc we'll be finalizing
on demand.
(scm_gc): Explicitly run finalizers here.
* libguile/threads.c (guilify_self_2): Run finalizers here if
queue_finalizer_async happened to run during guilify_self_1.
* configure.ac: Add check for GC_set_finalizer_notifier.
|
|
* libguile/foreign.c (scm_set_pointer_finalizer_x)
* libguile/ports.c (finalize_port)
* libguile/smob.c (scm_i_new_smob, scm_i_new_double_smob)
* libguile/struct.c (scm_i_alloc_struct)
* libguile/numbers.c (make_bignum): Use the new API.
|
|
* libguile/finalizers.h:
* libguile/finalizers.c: New files.
* libguile.h:
* libguile/Makefile.am: Add to build.
|
|
* libguile/smob.h (scm_new_smob, scm_new_double_smob): New constructors,
which do what SCM_NEWSMOB / SCM_NEWSMOB3 had done, but with inline
functions instead of macros. They also bail to scm_i_new_smob /
scm_i_new_double_smob in either the mark or the free case, so that the
inline definition doesn't reference other internal details like libgc
stuff.
(SCM_SMOB_TYPE_MASK et al): Move definitions up so the new_smob see
them as already being declared.
(SCM_NEWSMOB, SCM_RETURN_NEWSMOB, SCM_NEWSMOB2, SCM_RETURN_NEWSMOB2):
(SCM_NEWSMOB3, SCM_RETURN_NEWSMOB3): Reimplement in terms of the new
inline functions.
Remove now-unneeded bdw-gc include.
* libguile/smob.c (finalize_smob): Rename from scm_i_finalize_smob, and
make static.
(scm_i_new_smob, scm_i_new_double_smob): Slow-path allocators.
(scm_i_finalize_smob, scm_i_new_smob_with_mark_proc): Add
back-compatibility shims to preserve ABI.
* libguile/inline.c: Include smob.h, so as to reify scm_new_smob and
scm_new_double_smob.
|
|
* libguile/inline.h:
* libguile/gc.h (scm_cell, scm_double_cell, scm_words): Move
declarations and definitions back here, from inline.h. It's more
natural.
* libguile/inline.c: Include gc.h as well.
|
|
* libguile/__scm.h (SCM_C_EXTERN_INLINE): Move this definition here,
from inline.h. We'd like to support inline function definitions in
more header files: not just inline.h.
(SCM_CAN_INLINE, SCM_INLINE, SCM_INLINE_IMPLEMENTATION): New
definitions.
* libguile/gc.h (SCM_GC_MALLOC, SCM_GC_MALLOC_POINTERLESS): Define these
wrappers, which redirect to the GC_MALLOC macros when building Guile,
and the scm_gc_malloc functions otherwise. A step towards getting
BDW-GC out of Guile's API.
* libguile/inline.h: Simplify, using SCM_INLINE,
SCM_INLINE_IMPLEMENTATION, and SCM_IMPLEMENT_INLINES. Also use the
new SCM_GC_MALLOC macros.
|
|
* libguile/vports.c (sf_flush): Remove conditional testing the
position in the port's write_buf, as it is no longer used.
|
|
Fixes <http://bugs.gnu.org/10914>.
Reported by Tobias Brandt <tob.brandt@googlemail.com>.
* libguile/gc.h (scm_words): Change `n_words' to be `scm_t_uint32'.
* libguile/inline.h: Update extraneous declaration.
|
|
* benchmark-suite/benchmarks/ports.bm (sequence): New macro, formerly
local to the "rdelim" benchmark prefix.
(large-string): New procedure.
(%latin1-port, %utf8/ascii-port, %utf8/wide-port): Use it.
("peek-char", "char-ready?", "read-char"): Use `sequence'.
|
|
* libguile/init.c (scm_i_init_guile): Call `scm_init_random' before
`scm_init_macros'.
|
|
* module/ice-9/boot-9.scm (default-prompt-tag): Once parameters have
booted, redefine as a parameter.
(make-prompt-tag): Change from a gensym to a list. Thanks to Mark
Weaver for the suggestion.
* doc/ref/api-control.texi (Prompt Primitives): Update docs.
|
|
* module/ice-9/boot-9.scm (call-with-input-string)
(call-with-output-string): Implement in Scheme.
* libguile/strports.c (scm_call_with_output_string):
(scm_call_with_input_string): Dispatch to Scheme.
|
|
* libguile/srfi-13.c (scm_string_trim, scm_string_trim_right)
(scm_string_trim_both): Take the whitespace fast-path if the char_pred
is scm_char_set_whitespace.
* module/web/http.scm (read-header, split-and-trim, parse-quality-list):
(parse-param-component, parse-credentials, "Content-Type"):
(read-request-line, read-response-line): Use char-set:whitespace
instead of char-whitespace?. It avoids recursing into the VM.
|
|
* libguile/ports.c (scm_mode_bits): Parse the mode bits as latin1.
(scm_i_set_default_port_encoding, open_iconv_descriptors)
(scm_port_encoding, scm_set_port_encoding_x): Restrict the names of
encodings to ASCII.
|
|
* libguile/control.h: Remove scm_t_prompt_registers and
scm_c_make_prompt_registers.
(scm_c_abort): Take a pointer to a jmpbuf instead of a cookie. It
will serve the same purpose.
* libguile/control.c (reify_partial_continuation, scm_at_abort): Adapt
to new prompt representation.
* libguile/dynstack.h:
* libguile/dynstack.c (scm_dynstack_push_prompt): Prompts now have 5
words instead of 2, as they now push the fp, sp, ip, and jmpbuf on the
stack separately. This avoids allocation.
(scm_dynstack_find_prompt): Likewise, add return values for fp, sp,
etc.
(scm_dynstack_wind_prompt): Replaces scm_dynstack_relocate_prompt.
* libguile/eval.c (eval):
* libguile/stacks.c (find_prompt):
* libguile/throw.c (pre_init_catch): Adapt to the new prompt mechanism.
* libguile/vm-engine.c (vm_engine): Setjmp an on-stack jmpbuf every time
the VM enters. We can then re-use that jmpbuf for all prompts in that
invocation.
* libguile/vm-i-system.c (partial_cont_call): Adapt to change in prompt
representation. We don't need to wind here any more, since we pass in
the prompt's jmpbuf.
(prompt): Adapt to scm_dynstack_push_prompt change.
(abort): Adapt to vm_abort change.
* libguile/vm.h (struct scm_vm): No more cookie.
* libguile/vm.c (vm_abort): Adapt to scm_c_abort change.
(vm_reinstate_partial_continuation): Rewind the dynamic stack here,
now that we do have a valid jmpbuf.
(make_vm): No need to initialize a cookie.
|
|
* module/web/server.scm (extend-response): Micro-optimize to not mutate
data, and to copy as little as possible.
|
|
* libguile/ports.c (get_codepoint): Add inline keyword. It showed up
high in benchmarks, and it's static, so it's probably important to
inline.
|
|
* libguile/print.h: Remove internal declaration of
scm_i_print_symbol_name.
* libguile/print.c (symbol_has_extended_read_syntax): Optimize to avoid
calling symbol_to_string if we know the symbol cannot be mistaken for
a number.
(print_normal_symbol): Optimize to call display_string directly,
instead of jumping through scm_display.
(print_symbol): Rename from scm_i_print_symbol_name.
(scm_print_symbol_name, iprin1): Adapt to print_symbol name change.
|
|
* module/ice-9/boot-9.scm: Refine a comment about low-level port
functions. Move call-with-foo-port, with-input-from-foo, etc later in
the file, and define using `parameterize' instead of `dynamic-wind'.
Somewhat cleaner, and avoids thunk? checks for "swaports" in the old
implementation.
|
|
* module/ice-9/boot-9.scm: Move parameters earlier in the boot process.
The new with-output-to-port code will use it.
|
|
* module/ice-9/boot-9.scm (file-exists?, file-is-directory?): For the
fallback cases, use open-input-file instead of open-file with
OPEN_READ.
|
|
* module/ice-9/boot-9.scm (warn): Don't use with-output-to-port, as
we'll move that definition after the psyntax boot.
|
|
* module/ice-9/boot-9.scm: Update comment header for language
primitives.
|
|
* module/ice-9/boot-9.scm (close-io-port): Remove proc that was
deprecated in 2.0.
|
|
* module/ice-9/boot-9.scm: Inline r4rs.scm, in anticipation of more
refactorings.
* module/ice-9/r4rs.scm: Remove.
* module/Makefile.am: Update.
|
|
* module/langauge/elisp/compile-tree-il.scm (compile-lambda): Bind the
rest parameter to `#nil' instead of `()' by default.
|
|
* module/ice-9/r4rs.scm:
* module/ice-9/deprecated.scm (close-io-port): Deprecate.
|
|
Conflicts:
am/guilec
libguile/_scm.h
libguile/vm-i-scheme.c
module/language/elisp/compile-tree-il.scm
module/language/elisp/runtime.scm
module/language/elisp/runtime/macros.scm
module/language/tree-il/compile-glil.scm
module/language/tree-il/primitives.scm
|
|
* libguile/strings.c (scm_i_make_symbol): Use STRING_STRINGBUF
instead of SYMBOL_STRINGBUF to get the stringbuf of a string.
|