[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Patch for unsafe structure getters and setters
From: |
Will M Farr |
Subject: |
Re: [Chicken-users] Patch for unsafe structure getters and setters |
Date: |
Fri, 1 Sep 2006 18:12:00 -0400 |
Oops---unclosed list in the patch. The attached corrects that
problem and also comments out the duplicate definition of flonum? in
support.scm (since it's now defined in library.scm).
By the way, in a benchmark which compares the time to add two double-
precision floating-point numbers together one billion times, chicken
with the new non-checking fpXXX operators comes in only seven times
slower than straight C. I imagine that this is the most-biased way
to compare the two---i.e. any expression involving math library
operators like sqrt, log, exp, expt, etc, would show chicken in a
more favorable light, as would any expression which did more work
before looping (since every loop frame takes up stack/heap space, and
therefore requires more invocations of the GC). I think that's good
news!
Sorry,
Will
unsafe-structures.patch
Description: Binary data
On Sep 1, 2006, at 4:40 PM, Will M Farr wrote:
Hello all,
So, I was wrong about the unsafe vector-ref in Chicken---it doesn't
check indices or types. But, structure getters and setters do
check types even in unsafe mode. The attached patch against the
current darcs repository (i.e. darcs patch, not diff patch)
implements type-checks for struct getters and setters using
(ensure ...), so they will compile into nothing in unsafe mode.
Kon tells me that the misc-extn egg already has such a define-
record-type macro, so maybe there's a reason this isn't already in
the main distribution---if so, just ignore it :).
Sorry for all the confusion.
Will
<unsafe-structures.patch>
_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users