From 1a53979740c3ffa4174902111b39468c4978726d Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 9 Nov 2007 03:18:37 -0500 Subject: [PATCH 1/3] Fix with-fork stack effect --- extra/io/unix/launcher/launcher.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/io/unix/launcher/launcher.factor b/extra/io/unix/launcher/launcher.factor index 9804519fb6..61a6f706f6 100644 --- a/extra/io/unix/launcher/launcher.factor +++ b/extra/io/unix/launcher/launcher.factor @@ -31,7 +31,7 @@ USE: unix ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -: with-fork ( quot -- pid ) +: with-fork ( child parent -- pid ) fork [ zero? -rot if ] keep ; inline : prepare-execvp ( args -- cmd args ) From 04a5c54e08eb68fd416a0dc2ee643946c6a4c9b5 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 9 Nov 2007 03:19:01 -0500 Subject: [PATCH 2/3] Remove redundant check-ptr usage --- core/libc/libc-docs.factor | 3 +-- core/libc/libc.factor | 2 +- extra/io/buffers/buffers.factor | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/core/libc/libc-docs.factor b/core/libc/libc-docs.factor index 9596b98292..ba870560d6 100644 --- a/core/libc/libc-docs.factor +++ b/core/libc/libc-docs.factor @@ -26,8 +26,7 @@ HELP: memcpy HELP: check-ptr { $values { "c-ptr" "an alien address, byte array, or " { $link f } } { "checked" "an alien address or byte array with non-zero address" } } -{ $description "Throws an error if the input is " { $link f } ". Otherwise the object remains on the data stack. This word should be used to check the return values of " { $link malloc } " and " { $link realloc } " before use." } -{ $error-description "Callers of " { $link malloc } " and " { $link realloc } " should use " { $link check-ptr } " to throw an error in the case of a memory allocation failure." } ; +{ $description "Throws an error if the input is " { $link f } ". Otherwise the object remains on the data stack." } ; HELP: free { $values { "alien" c-ptr } } diff --git a/core/libc/libc.factor b/core/libc/libc.factor index 71b49e940a..88c5070d1f 100644 --- a/core/libc/libc.factor +++ b/core/libc/libc.factor @@ -84,4 +84,4 @@ PRIVATE> "void" "libc" "memcpy" { "void*" "void*" "ulong" } alien-invoke ; : with-malloc ( size quot -- ) - swap 1 calloc check-ptr swap keep free ; inline + swap 1 calloc swap keep free ; inline diff --git a/extra/io/buffers/buffers.factor b/extra/io/buffers/buffers.factor index e58cf3ead0..5d6eaebe6f 100644 --- a/extra/io/buffers/buffers.factor +++ b/extra/io/buffers/buffers.factor @@ -79,7 +79,7 @@ HINTS: search-buffer-until { fixnum fixnum simple-alien string } ; buffer-fill zero? ; : extend-buffer ( n buffer -- ) - 2dup buffer-ptr swap realloc check-ptr + 2dup buffer-ptr swap realloc over set-buffer-ptr set-buffer-size ; : check-overflow ( n buffer -- ) From e8a74a19c2ef73ad59c8f3269bf1d3e11333252a Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 9 Nov 2007 10:33:25 -0500 Subject: [PATCH 3/3] Fix USING: --- extra/io/windows/nt/sockets/sockets.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/io/windows/nt/sockets/sockets.factor b/extra/io/windows/nt/sockets/sockets.factor index 74538ac06a..47ab7795b0 100755 --- a/extra/io/windows/nt/sockets/sockets.factor +++ b/extra/io/windows/nt/sockets/sockets.factor @@ -1,5 +1,5 @@ USING: alien alien.c-types byte-arrays continuations destructors -io.nonblocking io io.sockets io.sockets.impl +io.nonblocking io io.sockets io.sockets.impl namespaces io.streams.duplex io.windows io.windows.nt io.windows.nt.backend windows.winsock kernel libc math sequences threads tuples.lib ; IN: io.windows.nt.sockets