On Thursday, 16 August 2007 05:53, Alon Bar-Lev wrote:
> On 8/15/07, Rafael J. Wysocki <[EMAIL PROTECTED]> wrote:
> > > You can malloc as much as you wish at initialization directly into
> > > the pointers... I just don't understand what may go wrong if you do 
> > > this...
> >
> > Nothing, really.  I prefer to have two global pointers and one contiguous
> > memory area than to have five global pointers and five different memory
> > areas.
> >
> > The problem is, we need to allocate all memory during the initialization,
> > because allocating memory later on may easily fail.  Now, it doesn't matter
> > too much if we take it in one piece or in several pieces.
> 
> Well... I tried to make this code more maintainable...

Hm, it might be nicer, but it's not so bad, IMO.

Anyway, if you want to clean up the code, then do it in separate patches,
not along with modifications that change functionality.

> But now when you say that your personal preferences is to make so
> complex code, I kind of giving up...
> Maybe (AND JUST MAYBE AS I DON'T BELIEVE IN IT) in kernel you hack
> these stuff...
> But in user mode you need to make your code as readable as you can...
> Maintenance is much more important than a few extra bytes of memory
> allocation (or make two blocks of unrelated memory be contiguous).

I have no problems whatsoever with maintaining this code.

> Allocating each buffer with its own size and reference is much
> readable than what you have done.

Well, maybe.  Now, this is _your_ preference, isn't it?

> The question is how do you want to proceed?
> 
> >> -             if (!cnt) {
> >> +             /* NOTICE: Assuming block->data large enough as lzo
> does not check for limits */
> > We can't make this assumption in general.
> I Don't understand the is THE ASSUMPTION needed for lzo...

Never mind, I've created a patch that replaces LZF with LZO.  I'll send it in a
while in a separate thread.

Greetings,
Rafael

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Suspend-devel mailing list
Suspend-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to