@@ -482,7 +483,8 @@ int toku_ft_loader_internal_init (/* out */ FTLOADER *blp,
ft_compare_funcbt_compare_functions[/*N*/],
constchar*temp_file_template,
LSNload_lsn,
TOKUTXNtxn)
TOKUTXNtxn,
BOOLreserve_memory)
// Effect: Allocate and initialize a FTLOADER, but do not create the extractor thread.
{
FTLOADERCALLOC(bl);// initialized to all zeros (hence CALLOC)
...
...
@@ -490,10 +492,14 @@ int toku_ft_loader_internal_init (/* out */ FTLOADER *blp,
bl->generate_row_for_put=g;
bl->cachetable=cachetable;
if(bl->cachetable)
if(reserve_memory&&bl->cachetable){
bl->did_reserve_memory=TRUE;
bl->reserved_memory=toku_cachetable_reserve_memory(bl->cachetable,2.0/3.0);// allocate 2/3 of the unreserved part (which is 3/4 of the memory to start with).
else
}
else{
bl->did_reserve_memory=FALSE;
bl->reserved_memory=512*1024*1024;// if no cache table use 512MB.