From: Karl MacMillan <kmacmillan@mentalrootkit.com>
To: Joshua Brindle <jbrindle@tresys.com>
Cc: selinux@tycho.nsa.gov, sds@tycho.nsa.gov
Subject: Re: [PATCH] clean up datum cast to uint32
Date: Thu, 27 Jul 2006 11:25:47 -0400 [thread overview]
Message-ID: <44C8DAFB.4060405@mentalrootkit.com> (raw)
In-Reply-To: <6FE441CD9F0C0C479F2D88F959B0158832A8E7@exchange.columbia.tresys.com>
Joshua Brindle wrote:
>> From: Karl MacMillan [mailto:kmacmillan@mentalrootkit.com]
>>
>>
>> Neither are fragile if the requirement is clearly documented.
>> Adding the struct just reinforces the requirement. The struct
>> layout on which both of these methods depend is clearly
>> guaranteed by the various C standards. The cast is completely
>> legal and safe.
>>
>
> Right, so was the uint32_t one, that doesn't mean it wasn't ugly.
>
>
Matter of opinion - obviously ours are different.
>>
>> Indirection through function pointer tables is never
>> intuitive in my opinion. The struct more directly represents
>> the fact that all symtab datums have shared fields.
>>
>
> Except the ones that don't, like level_datum_t.
Except the _one_ that doesn't.
Haven't looked at the code enough to know if a value might be useful.
I'd prefer not to have an exception. BTW, your solution has the same
problem with levels - it appears that you can pass any datum type but in
fact you can't. Would adding the header struct take up too much storage
space for levels?
> It sounds like you want
> to go toward OO anyway, why not put all the function pointers inside the
> structs val = foo_type->get_val()
>
>
Adds 32 to 64 bits to each struct for each function pointer, which is
not an acceptable size overhead in this case. You also incur the
overhead of a function call through a function pointer.
Karl
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2006-07-27 15:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-26 11:48 [PATCH] clean up datum cast to uint32 Joshua Brindle
2006-07-27 14:25 ` Karl MacMillan
2006-07-27 14:35 ` Stephen Smalley
2006-07-27 14:38 ` Joshua Brindle
2006-07-27 14:57 ` Karl MacMillan
2006-07-27 15:11 ` Joshua Brindle
2006-07-27 15:25 ` Karl MacMillan [this message]
2006-07-27 15:13 ` Stephen Smalley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44C8DAFB.4060405@mentalrootkit.com \
--to=kmacmillan@mentalrootkit.com \
--cc=jbrindle@tresys.com \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.