DEC = decrement

there is also an _CLDELETE_ARRAY, _CLDELETE_LARRAY, _CLDELETE_CARRAY...

these uses free (and should be matched for anything that is created
using _CL_NEWARRAY). Actually in the trunk it is the same rule, but
used delete[] because _CL_NEWARRAY used new [X]. Turns out calloc/free
is more efficient, i heard.

 _CLDELETE_CARRAY is for char array - unless you are developing on
msvc 6, then it is the equivalent of _CLDELETE_ARRAY

_CLDELETE_LARRAY is the same as _CLDELETE_ARRAY but doesn't null the pointer

The reason this is so complicated is for cross platform compatibility.
Old versions of microsoft visual studio was very sensitive, where as
now it is not sensitive at all, but linux still requires you to match
calloc/free and new/delete...

If you are developing on pure visualstudio 7+ then it really doesn't
matter what you use. If you are developing on gcc, then you only have
to watch out to match new/delete (_CLDELETE) and calloc/free (with
_ARRAY suffix)...

ben

2009/9/30 Itamar Syn-Hershko <ita...@divrei-tora.com>:
> Looking them up in the CLucene code itself will reveal the difference.
>
> Generally _CLDECDELETE is "declaring" a delete on objects which are being
> refcounted internally (Term for instance). _CLDELETE and _CLLDELETE will
> delete non-refcounted types (equivalent to delete), where the former sets
> the var to NULL while the other doesn't.
>
> Itamar.
> ________________________________
> From: Michel Nadeau [mailto:aka...@gmail.com]
> Sent: Wednesday, September 30, 2009 4:46 PM
> To: clucene-developers@lists.sourceforge.net
> Subject: [CLucene-dev] _CLDELETE vs _CLDECDELETE vs _CLLDELETE
>
> Hi !
>
> I'm in the process of migrating my 0.9.21 code to the 2.3.2 branch and I
> noticed in the test suite that there's now many "delete" functions:
>
> * _CLDELETE
> * _CLLDELETE
> * _CLDECDELETE
>
> I have 2 questions:
>
> * Is there other "delete" functions than these 3?
> * When should we each of these functions?
>
> Thanks!
>
> - Mike
> aka...@gmail.com
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> CLucene-developers mailing list
> CLucene-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/clucene-developers
>
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers

Reply via email to