#2 Patch to make Judy's memory manager pluggable ...

Judy-1.0.0
closed-rejected
nobody
None
5
2004-09-17
2003-10-29
No

A very crude patch that makes it easy to make the
memory manager used by Judy customizable. It doesn't
affect any current Judy app since the default is malloc
and free - exactly what JudyMalloc and JudyFree do today.

There is probably a very teensy performance penalty in
calling the allocator through a function pointer -
since Judy is so crazy in watching cycles maybe there
is something to watch there.

The attached file is a patch of a context diff with
respect to the Initial_LGPL download ...

Discussion

  • tcq_judy.patch

     
    Attachments
  • Logged In: YES
    user_id=344486

    After submitting this patch I discovered the Judy-am
    distribution - I redid the patch for this distribution and I
    am attaching it.

     
  • Patch to make Judy-am have a pluggable memory manager

     
    Attachments
  • Troy Heber
    Troy Heber
    2004-09-15

    • status: open --> closed-out-of-date
     
  • Logged In: YES
    user_id=344486

    Hi

    Is there any reason this patch was closed/rejected ?

    Was it accepted ? Thanks ..

     
  • Logged In: YES
    user_id=344486

    Hello

    I just downloaded the recent Judy-1.0.0 release and as far
    as I can see the patch I submitted will work just fine. It
    would be really useful for us if this patch would get
    accepted .. many thanks.

     
    • status: closed-out-of-date --> open-out-of-date
     
  • Troy Heber
    Troy Heber
    2004-09-16

    • milestone: --> Judy-1.0.0
    • status: open-out-of-date --> open-rejected
     
  • Troy Heber
    Troy Heber
    2004-09-16

    Logged In: YES
    user_id=171898

    Hello Sailesh,

    Thank you for your interest in Judy, and your patch submission.

    Unfortunately this patch can not be accepted because of the
    large number of
    limitations with the current implementation.

    For example:

    1) It must be called before any access to a Judy array - to
    be safe.
    2) It changes malloc(),free() for all Judy arrays -- not
    just one.
    3) It may not be called again unless all Judy arrays are
    free'ed.
    4) It does not allow for a separate malloc(),free() per Judy
    array.

    If these rules are not followed, then a probable core-dump
    will occur.

    In the future, Doug intends to add this capability into Judy
    allowing a change
    the malloc(), free() at any time without restrictions. To do
    this, each
    malloc() must be tagged to contain the associated free(). An
    array may have
    many buffers that came from different malloc()'s. therefore
    the correct free()
    must be remembered.

    In the current release of Judy, Doug made JudyMalloc() very
    simple. For now
    you may use your own version of JudyMalloc.o that contains
    JudySetMemoryHelpers(malloc,free);

    Again thank you for your contribution to Judy.

    The Judy Dev Team

     
  • Troy Heber
    Troy Heber
    2004-09-17

    • status: open-rejected --> closed-rejected