*** empty log message ***
This commit is contained in:
parent
e590e6130a
commit
bb7a22e049
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: awk_i.h,v 1.45 2006-08-16 09:35:21 bacon Exp $
|
||||
* $Id: awk_i.h,v 1.46 2006-08-21 02:53:42 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _XP_AWK_AWKI_H_
|
||||
@ -156,8 +156,10 @@ struct xp_awk_run_t
|
||||
|
||||
xp_awk_val_int_t* icache[100]; /* TODO: choose the optimal size */
|
||||
xp_awk_val_real_t* rcache[100]; /* TODO: choose the optimal size */
|
||||
xp_awk_val_ref_t* fcache[100]; /* TODO: choose the optimal size */
|
||||
xp_size_t icache_count;
|
||||
xp_size_t rcache_count;
|
||||
xp_size_t fcache_count;
|
||||
|
||||
xp_awk_nde_blk_t* active_block;
|
||||
xp_byte_t* pattern_range_state;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: run.c,v 1.172 2006-08-20 15:49:06 bacon Exp $
|
||||
* $Id: run.c,v 1.173 2006-08-21 02:53:42 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <xp/awk/awk_i.h>
|
||||
@ -425,6 +425,7 @@ static int __init_run (
|
||||
|
||||
run->icache_count = 0;
|
||||
run->rcache_count = 0;
|
||||
run->fcache_count = 0;
|
||||
|
||||
run->errnum = XP_AWK_ENOERR;
|
||||
|
||||
@ -515,6 +516,12 @@ static void __deinit_run (xp_awk_run_t* run)
|
||||
xp_awk_val_real_t* tmp = run->rcache[--run->rcache_count];
|
||||
xp_awk_freeval (run, (xp_awk_val_t*)tmp, xp_false);
|
||||
}
|
||||
|
||||
while (run->fcache_count > 0)
|
||||
{
|
||||
xp_awk_val_ref_t* tmp = run->fcache[--run->fcache_count];
|
||||
xp_awk_freeval (run, (xp_awk_val_t*)tmp, xp_false);
|
||||
}
|
||||
}
|
||||
|
||||
static int __run_main (xp_awk_run_t* run)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: val.c,v 1.51 2006-08-20 15:49:07 bacon Exp $
|
||||
* $Id: val.c,v 1.52 2006-08-21 02:53:42 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <xp/awk/awk_i.h>
|
||||
@ -198,8 +198,16 @@ xp_awk_val_t* xp_awk_makerefval (xp_awk_run_t* run, int id, xp_awk_val_t** adr)
|
||||
{
|
||||
xp_awk_val_ref_t* val;
|
||||
|
||||
val = (xp_awk_val_ref_t*) xp_malloc (xp_sizeof(xp_awk_val_ref_t));
|
||||
if (val == XP_NULL) return XP_NULL;
|
||||
if (run->fcache_count > 0)
|
||||
{
|
||||
val = run->fcache[--run->fcache_count];
|
||||
}
|
||||
else
|
||||
{
|
||||
val = (xp_awk_val_ref_t*)
|
||||
xp_malloc (xp_sizeof(xp_awk_val_ref_t));
|
||||
if (val == XP_NULL) return XP_NULL;
|
||||
}
|
||||
|
||||
val->type = XP_AWK_VAL_REF;
|
||||
val->ref = 0;
|
||||
@ -267,7 +275,13 @@ xp_printf (XP_T("\n"));*/
|
||||
}
|
||||
else if (val->type == XP_AWK_VAL_REF)
|
||||
{
|
||||
xp_free (val);
|
||||
if (cache == xp_true &&
|
||||
run->fcache_count < xp_countof(run->fcache))
|
||||
{
|
||||
run->fcache[run->fcache_count++] =
|
||||
(xp_awk_val_ref_t*)val;
|
||||
}
|
||||
else xp_free (val);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user