[Date Prev][Date Next] [Chronological] [Thread] [Top]

IDL management in idl.c



ITS#1651 patch I posted yesterday tries to use alloca() first and then use
malloc()
if alloca() fails. We allocate BDB_IDL_DB_SIZE memory either in
stack or heap, depending on its size (BDB_IDL_DB_SIZE).
As a result, we can use large value of BDB_IDL_DB_SIZE without worrying
about stack size limit.

An improvement to the current patch would be
to use multiple moderate size IDL buffers by managing overflows in the
DB_MULTIPLE_NEXT loop.
For the cases that IDLs are of moderate size, we can avoid using malloc().
Only when we can't allocate from stack, then we pay for the price of malloc
().
Because we don't know the amount of memory in advance as in Howard's recent
filterindex.c patch,
we don't seem to be able to resort to that solution in this idl.c case.
Comments are welcome ...

- Jong

------------------------
Jong Hyuk Choi
IBM Thomas J. Watson Research Center - Enterprise Linux Group
P. O. Box 218, Yorktown Heights, NY 10598
email: jongchoi@us.ibm.com
(phone) 914-945-3979    (fax) 914-945-4425   TL: 862-3979