fix fcopy
parent
f75e3ca0a8
commit
a7036e5e7a
6
Makefile
6
Makefile
|
|
@ -1,5 +1,5 @@
|
||||||
CC = gcc34
|
CC = gcc
|
||||||
CFLAGS = -Os -ffast-math -march=pentium4 -Wall -fomit-frame-pointer
|
CFLAGS = -g -Wall
|
||||||
LIBS = -lm
|
LIBS = -lm
|
||||||
STRIP = strip
|
STRIP = strip
|
||||||
|
|
||||||
|
|
@ -18,7 +18,7 @@ OBJS = native/arithmetic.o native/array.o native/bignum.o \
|
||||||
|
|
||||||
f: $(OBJS)
|
f: $(OBJS)
|
||||||
$(CC) $(LIBS) -o $@ $(OBJS)
|
$(CC) $(LIBS) -o $@ $(OBJS)
|
||||||
$(STRIP) $@
|
# $(STRIP) $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OBJS)
|
rm -f $(OBJS)
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,8 @@
|
||||||
|
|
||||||
+ native:
|
+ native:
|
||||||
|
|
||||||
|
- fix error postoning -- not all errors thrown by i/o code are
|
||||||
|
postponed
|
||||||
- sbuf-hashcode
|
- sbuf-hashcode
|
||||||
- vector-hashcode
|
- vector-hashcode
|
||||||
- irc: stack underflow?
|
- irc: stack underflow?
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ DEFER: can-write?
|
||||||
DEFER: add-write-io-task
|
DEFER: add-write-io-task
|
||||||
DEFER: write-fd-8
|
DEFER: write-fd-8
|
||||||
DEFER: add-copy-io-task
|
DEFER: add-copy-io-task
|
||||||
|
DEFER: pending-io-error
|
||||||
DEFER: next-io-task
|
DEFER: next-io-task
|
||||||
|
|
||||||
IN: math
|
IN: math
|
||||||
|
|
@ -247,6 +248,7 @@ IN: cross-compiler
|
||||||
add-write-io-task
|
add-write-io-task
|
||||||
write-fd-8
|
write-fd-8
|
||||||
add-copy-io-task
|
add-copy-io-task
|
||||||
|
pending-io-error
|
||||||
next-io-task
|
next-io-task
|
||||||
room
|
room
|
||||||
os-env
|
os-env
|
||||||
|
|
|
||||||
|
|
@ -73,4 +73,5 @@ USE: threads
|
||||||
dup wait-to-accept accept-fd ;
|
dup wait-to-accept accept-fd ;
|
||||||
|
|
||||||
: blocking-copy ( in out -- )
|
: blocking-copy ( in out -- )
|
||||||
[ add-copy-io-task (yield) ] callcc0 2drop ;
|
[ add-copy-io-task (yield) ] callcc0
|
||||||
|
pending-io-error pending-io-error ;
|
||||||
|
|
|
||||||
|
|
@ -100,3 +100,8 @@ void pending_io_error(PORT* port)
|
||||||
general_error(ERROR_IO,io_error);
|
general_error(ERROR_IO,io_error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void primitive_pending_io_error(void)
|
||||||
|
{
|
||||||
|
pending_io_error(untag_port(dpop()));
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,3 +42,4 @@ void collect_port(PORT* port);
|
||||||
void postpone_io_error(PORT* port, const char* func);
|
void postpone_io_error(PORT* port, const char* func);
|
||||||
void io_error(const char* func);
|
void io_error(const char* func);
|
||||||
void pending_io_error(PORT* port);
|
void pending_io_error(PORT* port);
|
||||||
|
void primitive_pending_io_error(void);
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,7 @@ XT primitives[] = {
|
||||||
primitive_add_write_io_task,
|
primitive_add_write_io_task,
|
||||||
primitive_write_8,
|
primitive_write_8,
|
||||||
primitive_add_copy_io_task,
|
primitive_add_copy_io_task,
|
||||||
|
primitive_pending_io_error,
|
||||||
primitive_next_io_task,
|
primitive_next_io_task,
|
||||||
primitive_room,
|
primitive_room,
|
||||||
primitive_os_env,
|
primitive_os_env,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
extern XT primitives[];
|
extern XT primitives[];
|
||||||
#define PRIMITIVE_COUNT 147
|
#define PRIMITIVE_COUNT 148
|
||||||
|
|
||||||
CELL primitive_to_xt(CELL primitive);
|
CELL primitive_to_xt(CELL primitive);
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,6 @@ bool can_write(PORT* port, FIXNUM len)
|
||||||
{
|
{
|
||||||
CELL buf_capacity;
|
CELL buf_capacity;
|
||||||
|
|
||||||
pending_io_error(port);
|
|
||||||
|
|
||||||
if(port->type != PORT_WRITE)
|
if(port->type != PORT_WRITE)
|
||||||
general_error(ERROR_INCOMPATIBLE_PORT,tag_object(port));
|
general_error(ERROR_INCOMPATIBLE_PORT,tag_object(port));
|
||||||
|
|
||||||
|
|
@ -42,6 +40,7 @@ void primitive_can_write(void)
|
||||||
{
|
{
|
||||||
PORT* port = untag_port(dpop());
|
PORT* port = untag_port(dpop());
|
||||||
FIXNUM len = to_fixnum(dpop());
|
FIXNUM len = to_fixnum(dpop());
|
||||||
|
pending_io_error(port);
|
||||||
dpush(tag_boolean(can_write(port,len)));
|
dpush(tag_boolean(can_write(port,len)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -73,6 +72,8 @@ void write_char_8(PORT* port, FIXNUM ch)
|
||||||
{
|
{
|
||||||
char c = (char)ch;
|
char c = (char)ch;
|
||||||
|
|
||||||
|
pending_io_error(port);
|
||||||
|
|
||||||
if(!can_write(port,1))
|
if(!can_write(port,1))
|
||||||
io_error(__FUNCTION__);
|
io_error(__FUNCTION__);
|
||||||
|
|
||||||
|
|
@ -94,6 +95,8 @@ void write_string_8(PORT* port, STRING* str)
|
||||||
{
|
{
|
||||||
char* c_str;
|
char* c_str;
|
||||||
|
|
||||||
|
pending_io_error(port);
|
||||||
|
|
||||||
/* Note this ensures the buffer is large enough to fit the string */
|
/* Note this ensures the buffer is large enough to fit the string */
|
||||||
if(!can_write(port,str->capacity))
|
if(!can_write(port,str->capacity))
|
||||||
io_error(__FUNCTION__);
|
io_error(__FUNCTION__);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue