Fix memory safety issue
parent
e3416ec170
commit
2fd1899d84
|
@ -6,11 +6,11 @@ bit-arrays namespaces io ;
|
||||||
2dup length >= [
|
2dup length >= [
|
||||||
3drop
|
3drop
|
||||||
] [
|
] [
|
||||||
f pick pick set-nth-unsafe >r over + r> clear-flags
|
f 2over set-nth-unsafe >r over + r> clear-flags
|
||||||
] if ; inline
|
] if ; inline
|
||||||
|
|
||||||
: (nsieve-bits) ( count i seq -- count )
|
: (nsieve-bits) ( count i seq -- count )
|
||||||
2dup length <= [
|
2dup length < [
|
||||||
2dup nth-unsafe [
|
2dup nth-unsafe [
|
||||||
over dup 2 * pick clear-flags
|
over dup 2 * pick clear-flags
|
||||||
rot 1+ -rot ! increment count
|
rot 1+ -rot ! increment count
|
||||||
|
|
|
@ -10,7 +10,7 @@ arrays namespaces io ;
|
||||||
] if ; inline
|
] if ; inline
|
||||||
|
|
||||||
: (nsieve) ( count i seq -- count )
|
: (nsieve) ( count i seq -- count )
|
||||||
2dup length <= [
|
2dup length < [
|
||||||
2dup nth-unsafe [
|
2dup nth-unsafe [
|
||||||
over dup 2 * pick clear-flags
|
over dup 2 * pick clear-flags
|
||||||
rot 1+ -rot ! increment count
|
rot 1+ -rot ! increment count
|
||||||
|
|
Loading…
Reference in New Issue