On Tue, 4 Nov 2008 14:26:39 -0800 (PST), s0suk3@gmail.co m wrote:
[snip]
>
>If you're talking about memory leaks, I seriously believe that taking
>care to avoid them is better than all the methods you've described
>below.
I'm not sure where you got the idea that I was talking about
memory leaks, but I wasn't.
[snip]
>
>The user code can still modify the index :-)
Indeed, they can, but not in a way that creates a valid
descriptor.
Thank you for your comments.
Richard Harter, cri@tiac.net
http://home.tiac.net/~cri, http://www.varinoma.com
Save the Earth now!!
It's the only planet with chocolate.
>On Nov 4, 3:24=A0pm, cri@tiac.net (Richard Harter) wrote:
>Suppose we are writing a program in C and that we have a
>particular kind of object (in the sense of OO programming) that I
>particular kind of object (in the sense of OO programming) that I
>The problem is that C pointers are fragile, that they carry no
>certificate of validity,
>certificate of validity,
>If you're talking about memory leaks, I seriously believe that taking
>care to avoid them is better than all the methods you've described
>below.
memory leaks, but I wasn't.
>
>
>and that they provide unrestricted
>access to the struct contents.
>access to the struct contents.
>A more robust way would be to maintain an array of bobble_locator
>>
>structs inside the package, and store the array index inside the
>bobble_descrip tor struct. =A0This has two benefits: (a) we can
>check the validity of the index, and (b) the user code cannot
>access the bobble directly.
>>
>structs inside the package, and store the array index inside the
>bobble_descrip tor struct. =A0This has two benefits: (a) we can
>check the validity of the index, and (b) the user code cannot
>access the bobble directly.
>The user code can still modify the index :-)
descriptor.
Thank you for your comments.
Richard Harter, cri@tiac.net
http://home.tiac.net/~cri, http://www.varinoma.com
Save the Earth now!!
It's the only planet with chocolate.