[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-ha-dev
Subject:    Re: [Linux-ha-dev] MALLOC, malloc, cl_malloc, g_new ??
From:       Lars Marowsky-Bree <lmb () suse ! de>
Date:       2004-02-27 20:27:29
Message-ID: 20040227202729.GN4293 () marowsky-bree ! de
[Download RAW message or body]

On 2004-02-24T13:06:29,
   Lars Ellenberg <l.g.e@web.de> said:

Sorry for only answering just now; the conference was, surprisingly,
without any e-mail access at all...

> why is MALLOC defined in every other C file,
> and not in some common header file?

Because the code needs a cleanup? ;)

> why is it sometimes used directly,
> where I think g_new should have been used?

Because the code needs a cleanup? ;)

There's a difference though between g_malloc and malloc(), ie g_malloc()
will abort() if it fails to return memory. That may not always be what
we want.

> why is malloc sometimes used directly?
> 
> why is REALLOC never defined, but realloc used directly?
> ... CALLOC ... ?

No idea.

> what is the preferred way of allocating memory in heartbeat?
> 
> MALLOC, malloc, cl_malloc, g_new ??

Actually, ha_malloc(), as far as I know.

A cleanup on this one is surely in order.


Sincerely,
    Lars Marowsky-Brée <lmb@suse.de>

-- 
High Availability & Clustering	      \ ever tried. ever failed. no matter.
SUSE Labs			      | try again. fail again. fail better.
Research & Development, SUSE LINUX AG \ 	-- Samuel Beckett

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic