Re: More benchmark bullshit, and Linux luser mating calls... (was Re: Linux betas NT in TPC testing, running Oracle8

From: Anthony Ord <nws_at_rollingthunder.demon.co.uk>
Date: Sun, 02 May 1999 10:03:37 GMT
Message-ID: <373121cc.3352602_at_news.demon.co.uk>


On Sat, 01 May 1999 15:55:03 GMT, cbbrowne_at_news.brownes.org (Christopher B. Browne) wrote:

>On Sat, 01 May 1999 15:20:35 GMT, Anthony Ord
><nws_at_rollingthunder.demon.co.uk> posted:
>>If you free no 714 then try to access it with a pointer you
>>should get a SEGV (sometimes).
>
>No, if you're using an array to implement a linked list, then if you
>"free" entry #714, then you aren't changing the array, but rather
>something in a separate data structure independent of the array.

If I'm using an array, then I'm not accessing with a pointer. "Free" was actually the opposite of "new" in that context.

>In effect, you *can't* free #714; that's a position in a fixed array
>that you defined. You can't get rid of #714 without getting rid of
>everything from #714 to the end of the array.

I agree.

>There may be need to worry aboug SEGV when looking at whatever the
>contents of #714 pointed to, although if that too is in an array, not
>necessarily so.

I view SEGV as a debugging tool rather than a problem.

>The point here is that if you're using arrays, the array management
>code can probably find out-of-bound situations *MORE* successfully and
>accurately than can the memory manager. There's no need for SEGV
>unless the array manager decides to fail. Or if you're working with a
>language like C, where arrays are somewhat simulated objects, and
>there's no "array manager."

But why bother? If you are out-of-bounds with Pascal, or if you try to read a freed pointer, the same thing happens. Your program dies. Pointers are arguable more effective as they also trap in-of-bounds errors, which the array wouldn't.

>In my FORTH days, I used both array schemes that included bounds
>checkers, and array schemes that didn't. If there's no bounds
>checker, then you run the risk of SEGV. If there is, then there's no
>such risk.

What happens when the bounds checker triggers? Does your program stop?

Regards

Anthony

-- 
-----------------------------------------
| And when our worlds                   |
| They fall apart                       |
| When the walls come tumbling in       |
| Though we may deserve it              |
| It will be worth it  - Depeche Mode   |
-----------------------------------------
Received on Sun May 02 1999 - 12:03:37 CEST

Original text of this message