mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
Reduce the number of calls to fcntl in sexp_read.
This commit is contained in:
parent
09b1e3041c
commit
d6b66a32fd
1 changed files with 2 additions and 2 deletions
4
sexp.c
4
sexp.c
|
@ -2788,7 +2788,6 @@ sexp sexp_read_raw (sexp ctx, sexp in) {
|
||||||
int c1, c2, line;
|
int c1, c2, line;
|
||||||
sexp tmp2;
|
sexp tmp2;
|
||||||
sexp_gc_var2(res, tmp);
|
sexp_gc_var2(res, tmp);
|
||||||
sexp_check_block_port(ctx, in, 0);
|
|
||||||
sexp_gc_preserve2(ctx, res, tmp);
|
sexp_gc_preserve2(ctx, res, tmp);
|
||||||
|
|
||||||
scan_loop:
|
scan_loop:
|
||||||
|
@ -3252,7 +3251,6 @@ sexp sexp_read_raw (sexp ctx, sexp in) {
|
||||||
|
|
||||||
if (sexp_port_sourcep(in) && sexp_pointerp(res))
|
if (sexp_port_sourcep(in) && sexp_pointerp(res))
|
||||||
sexp_immutablep(res) = 1;
|
sexp_immutablep(res) = 1;
|
||||||
sexp_maybe_unblock_port(ctx, in);
|
|
||||||
sexp_gc_release2(ctx);
|
sexp_gc_release2(ctx);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -3260,6 +3258,7 @@ sexp sexp_read_raw (sexp ctx, sexp in) {
|
||||||
sexp sexp_read_op (sexp ctx, sexp self, sexp_sint_t n, sexp in) {
|
sexp sexp_read_op (sexp ctx, sexp self, sexp_sint_t n, sexp in) {
|
||||||
sexp res;
|
sexp res;
|
||||||
sexp_assert_type(ctx, sexp_iportp, SEXP_IPORT, in);
|
sexp_assert_type(ctx, sexp_iportp, SEXP_IPORT, in);
|
||||||
|
sexp_check_block_port(ctx, in, 0);
|
||||||
res = sexp_read_raw(ctx, in);
|
res = sexp_read_raw(ctx, in);
|
||||||
if (res == SEXP_CLOSE)
|
if (res == SEXP_CLOSE)
|
||||||
res = sexp_read_error(ctx, "too many ')'s", SEXP_NULL, in);
|
res = sexp_read_error(ctx, "too many ')'s", SEXP_NULL, in);
|
||||||
|
@ -3269,6 +3268,7 @@ sexp sexp_read_op (sexp ctx, sexp self, sexp_sint_t n, sexp in) {
|
||||||
#endif
|
#endif
|
||||||
else if (res == SEXP_RAWDOT)
|
else if (res == SEXP_RAWDOT)
|
||||||
res = sexp_read_error(ctx, "unexpected '.'", SEXP_NULL, in);
|
res = sexp_read_error(ctx, "unexpected '.'", SEXP_NULL, in);
|
||||||
|
sexp_maybe_unblock_port(ctx, in);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue