Tim, yes I'm going to modify the code to reflect just that :) I wanted to have also a non talloc possibility, and just toght ot is possible simply making a malloc instead of a talloc if the mem_ctx is null.
:) Simo. On Mon, 2002-07-15 at 07:54, Tim Potter wrote: > On Sat, Jul 13, 2002 at 06:01:41PM +0200, Simo Sorce wrote: > > > any objection into adding a function to talloc to import a previously > > allocated memory? > > > > something like that: > > > > bool talloc_memorize(TALLOC_CTX *t, void *src, size_t src_size) > > Hi Simo. > > Isn't this going to cause horrible problems if you pass in a a piece of > memory that has already been allocated by talloc? It looks like you > must pass in memory allocated my mallloc() unless you want to have a > double free happening sometime later. This will be very difficult to > debug. > > > it would be useful to add allocated strings returned from another > > function to a talloc context ... the only problem I see is the size one. > > Why not just use a talloc context for these allocated strings in the > first place? > > > Tim. > -- Simo Sorce ---------- Una scelta di liberta': Software Libero. A choice of freedom: Free Software. http://www.softwarelibero.it
