incubator-celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Broekhuis <>
Subject Re: [Native-OSGi] OSGi API: Allocated memory ownership
Date Tue, 05 Jun 2012 19:48:33 GMT
>  Hm, I think you misunderstood me, or I did not fully understand the
> problem. We are talking about memory which is actively allocated by the
> framework (by calls to free or some hook provided by a bundle) but which is
> owned by the API user, right?

Yes, this is the case.

> My suggestion was (if we really want that kind of complexity) that the
> bundle writer (user of the API) can use the function pointer passed to the
> memory hook by the framework to decide on which internal pool the memory
> should be allocated. So the user has full control over the lifetime (e.g.
> via memory pools).

Yeah I see, but that would introduce a rather complex "allocate" method in
the bundle to handle the calls, especially if the same call has to be
handled differently each time.

>  I'm with Pepijn on this one, user the regular "malloc" and let the user
>> "free" it is the best for now I think.
>>  That is definitely the most "common sense" solutions and is what I also
> suggested at the very beginning.

Ok, so this is settled for now. How we handle this in Celix will be another

Met vriendelijke groet,

Alexander Broekhuis

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message