libmsrpc for Samba 3

derrell at samba.org derrell at samba.org
Wed Jul 20 17:26:32 GMT 2005


"Gerald (Jerry) Carter" <jerry at samba.org> writes:

> derrell at samba.org wrote:
>
> | My suspicion is that you'll find that most of the
> | time, the operation structure is for local use and
> | can be a stack variable, so it need not have
> | the overhead of malloc/free.
>
> Do you mean the top level structure?  Or the fields?
> We use talloc() for a lot of string values (UNISTRXXX).

I mean the top-level structure, what we've been calling "op".  Without passing
parameters to an initialize_operation() or similar function, allocating memory
in that function for strings and other fields isn't really doable.

OTOH, if lots (or even some) of the fields within an operation structure are
talloc()ed, then talloc()ing the operation structure itself and hanging the
fields off of its memory context may make sense.  I hadn't thought about the
fields being talloc()ed.

Derrell


More information about the samba-technical mailing list