r20242?

Alexander Bokovoy ab at samba.org
Wed Dec 20 01:46:39 GMT 2006


tridge at samba.org wrote:
>> My thinking is against it -- i.e. you probably shouldn't specify
>> const for arguments-pointers which you intend to use as parent
>> context in the function.
> 
> nope, I disagree. All you should think about is if the data itself 
> will be modified. That's what matters for the optimisations and
> checks that the compiler will do outside of the talloc code. The bits
> inside the talloc code is not the concern of the people using the
> API.
My main argument is in relying on hierachies built by talloc for user's
needs. As we have an API to traverse childs of the context, this API
could be used for implementing some structures as talloc guarantees us
to provide this hierarchy.

In this case allocating a structure off of context is changing user data.
-- 
/ Alexander Bokovoy
Samba Team                      http://www.samba.org/
ALT Linux Team                  http://www.altlinux.org/
Midgard Project Ry              http://www.midgard-project.org/


More information about the samba-technical mailing list