Changeset 307 in svn for trunk


Ignore:
Timestamp:
2006-12-09T04:42:09+01:00 (8 years ago)
Author:
Xuefer
Message:

stack interface changes

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/main.m4

    r302 r307  
    3939    IFSTORE(`
    4040        IFASSERT(`{
    41             if (!xc_stack_size(&processor->allocsizes)) {
     41            if (!xc_stack_count(&processor->allocsizes)) {
    4242                fprintf(stderr, "mismatch `$@' at line %d\n", __LINE__);
    4343            }
  • trunk/stack.c

    r11 r307  
    44typedef xc_stack_t* S;
    55
    6 void xc_stack_init(S stack)
     6void xc_stack_init_ex(S stack, int initsize)
    77{
    88    stack->cnt = 0;
    9     stack->size = 8;
     9    stack->size = initsize;
    1010    stack->data = malloc(sizeof(void *) * stack->size);
    1111}
     
    4343}
    4444
    45 int xc_stack_size(S stack)
     45int xc_stack_count(S stack)
    4646{
    4747    assert(stack != NULL);
  • trunk/stack.h

    r1 r307  
    77
    88#define S xc_stack_t*
    9 void xc_stack_init(S stack);
     9void xc_stack_init_ex(S stack, int initsize);
     10#define xc_stack_init(stack) xc_stack_init_ex(stack, 8)
    1011void xc_stack_destroy(S stack);
    1112void xc_stack_push(S stack, void *item);
     
    1314void *xc_stack_top(S stack);
    1415void *xc_stack_get(S stack, int n);
    15 int xc_stack_size(S stack);
     16int xc_stack_count(S stack);
    1617void xc_stack_reverse(S stack);
    1718#undef S
  • trunk/xcache.c

    r305 r307  
    606606    for (i = 0; i < cachecount; i ++) {
    607607        s = &holds[i];
    608         TRACE("holded %d", xc_stack_size(s));
    609         if (xc_stack_size(s)) {
     608        TRACE("holded %d", xc_stack_count(s));
     609        if (xc_stack_count(s)) {
    610610            cache = ((xc_entry_t *)xc_stack_top(s))->cache;
    611611            ENTER_LOCK(cache) {
    612                 while (xc_stack_size(s)) {
     612                while (xc_stack_count(s)) {
    613613                    xce = (xc_entry_t*) xc_stack_pop(s);
    614614                    TRACE("unhold %s", xce->name.str.val);
Note: See TracChangeset for help on using the changeset viewer.