Re: patch: cache Data allocation
On Thu, May 29, 2008 at 05:51:02PM +0000, corvid wrote:
This is to make my unref()s cleaner. As it was in the prototype code, I would always unref at IOClose time. This made the reference count negative for file not found, which I didn't like. I could've tested for GotHeader, but it seemed more natural to test for data before unref()ing data.
I'd prefer GotHeader because that's what Cache_process_queue() tests for, and thus Data doesn't become an implicit flag.
I think it's all right for me to put that Cache_process_queue(entry) inside an entry->Data test -- at least I couldn't find anything bad happening.
BTW, funny as it may seem, I don't yet know what data unref you're talking about! :-) -- Cheers Jorge.-
Jorge wrote:
On Thu, May 29, 2008 at 05:51:02PM +0000, corvid wrote:
This is to make my unref()s cleaner. As it was in the prototype code, I would always unref at IOClose time. This made the reference count negative for file not found, which I didn't like. I could've tested for GotHeader, but it seemed more natural to test for data before unref()ing data.
I'd prefer GotHeader because that's what Cache_process_queue() tests for, and thus Data doesn't become an implicit flag.
All right.
I think it's all right for me to put that Cache_process_queue(entry) inside an entry->Data test -- at least I couldn't find anything bad happening.
BTW, funny as it may seem, I don't yet know what data unref you're talking about! :-)
The reference counting in my charset-translating-in-cache code. (For any others in the audience: I keep track of how many things are reading the UTF8-ized version of the cache entry data.)
participants (2)
-
corvid@lavabit.com
-
jcid@dillo.org