Back to index

plt-scheme  4.2.1
Classes | Defines | Typedefs | Functions | Variables
typd_mlc.c File Reference
#include "private/gc_pmark.h"
#include "gc_typed.h"

Go to the source code of this file.

Classes

struct  ext_descr
union  ComplexDescriptor
struct  ComplexDescriptor::LeafDescriptor
struct  ComplexDescriptor::ComplexArrayDescriptor
struct  ComplexDescriptor::SequenceDescriptor

Defines

#define TYPD_EXTRA_BYTES   (sizeof(word) - EXTRA_BYTES)
#define LEAF_TAG   1
#define ARRAY_TAG   2
#define SEQUENCE_TAG   3
#define TAG   ld.ld_tag
#define ED_INITIAL_SIZE   100;
#define COMPLEX   2
#define LEAF   1
#define SIMPLE   0
#define NO_MEM   (-1)
#define OPT_THRESHOLD   50
#define HIGH_BIT   (((word)1) << (WORDSZ - 1))
#define GENERAL_MALLOC(lb, k)   (GC_PTR)GC_clear_stack(GC_generic_malloc((word)lb, k))
#define GENERAL_MALLOC_IOP(lb, k)   (GC_PTR)GC_clear_stack(GC_generic_malloc_ignore_off_page(lb, k))

Typedefs

typedef union ComplexDescriptor complex_descriptor

Functions

signed_word GC_add_ext_descriptor (GC_bitmap bm, word nbits)
GC_descr GC_double_descr (GC_descr descriptor, word nwords)
complex_descriptorGC_make_sequence_descriptor ()
int GC_make_array_descriptor (word nelements, word size, GC_descr descriptor, GC_descr *simple_d, complex_descriptor **complex_d, struct LeafDescriptor *leaf)
complex_descriptorGC_make_sequence_descriptor (complex_descriptor *first, complex_descriptor *second)
mse *GC_typed_mark_proc GC_PROTO ((register word *addr, register mse *mark_stack_ptr, mse *mark_stack_limit, word env))
void GC_init_explicit_typing ()
mseGC_typed_mark_proc (word *addr, mse *mark_stack_ptr, mse *mark_stack_limit, word env)
word GC_descr_obj_size (complex_descriptor *d)
mseGC_push_complex_descriptor (word *addr, complex_descriptor *d, mse *msp, mse *msl)
mseGC_array_mark_proc (word *addr, mse *mark_stack_ptr, mse *mark_stack_limit, word env)
GC_descr GC_make_descriptor (GC_bitmap bm, size_t len)
ptr_t GC_clear_stack ()
char * GC_malloc_explicitly_typed (size_t lb, GC_descr d)
char * GC_malloc_explicitly_typed_ignore_off_page (size_t lb, GC_descr d)
char * GC_calloc_explicitly_typed (size_t n, size_t lb, GC_descr d)

Variables

GC_bool GC_explicit_typing_initialized = FALSE
int GC_explicit_kind
int GC_array_kind
ext_descrGC_ext_descriptors
word GC_ed_size = 0
word GC_avail_descr = 0
int GC_typed_mark_proc_index
int GC_array_mark_proc_index
GC_descr GC_bm_table [WORDSZ/2]
ptr_tGC_eobjfreelist
ptr_tGC_arobjfreelist

Class Documentation

struct ext_descr

Definition at line 55 of file typd_mlc.c.

Class Members
word ed_bitmap
GC_bool ed_continued
union ComplexDescriptor

Definition at line 64 of file typd_mlc.c.

Collaboration diagram for ComplexDescriptor:
Class Members
struct ComplexArrayDescriptor ad
struct LeafDescriptor ld
struct SequenceDescriptor sd
struct ComplexDescriptor::LeafDescriptor

Definition at line 65 of file typd_mlc.c.

Class Members
GC_descr ld_descriptor
word ld_nelements
word ld_size
word ld_tag
struct ComplexDescriptor::ComplexArrayDescriptor

Definition at line 74 of file typd_mlc.c.

Collaboration diagram for ComplexDescriptor::ComplexArrayDescriptor:
Class Members
union ComplexDescriptor * ad_element_descr
word ad_nelements
word ad_tag
struct ComplexDescriptor::SequenceDescriptor

Definition at line 80 of file typd_mlc.c.

Collaboration diagram for ComplexDescriptor::SequenceDescriptor:
Class Members
union ComplexDescriptor * sd_first
union ComplexDescriptor * sd_second
word sd_tag

Define Documentation

#define ARRAY_TAG   2

Definition at line 76 of file typd_mlc.c.

#define COMPLEX   2

Definition at line 197 of file typd_mlc.c.

#define ED_INITIAL_SIZE   100;

Definition at line 93 of file typd_mlc.c.

#define GENERAL_MALLOC (   lb,
 
)    (GC_PTR)GC_clear_stack(GC_generic_malloc((word)lb, k))

Definition at line 623 of file typd_mlc.c.

Definition at line 626 of file typd_mlc.c.

#define HIGH_BIT   (((word)1) << (WORDSZ - 1))
#define LEAF   1

Definition at line 198 of file typd_mlc.c.

#define LEAF_TAG   1

Definition at line 67 of file typd_mlc.c.

#define NO_MEM   (-1)

Definition at line 200 of file typd_mlc.c.

#define OPT_THRESHOLD   50
#define SEQUENCE_TAG   3

Definition at line 82 of file typd_mlc.c.

#define SIMPLE   0

Definition at line 199 of file typd_mlc.c.

#define TAG   ld.ld_tag

Definition at line 87 of file typd_mlc.c.

#define TYPD_EXTRA_BYTES   (sizeof(word) - EXTRA_BYTES)

Definition at line 42 of file typd_mlc.c.


Typedef Documentation


Function Documentation

Definition at line 104 of file typd_mlc.c.

{
    register size_t nwords = divWORDSZ(nbits + WORDSZ-1);
    register signed_word result;
    register word i;
    register word last_part;
    register int extra_bits;
    DCL_LOCK_STATE;

    DISABLE_SIGNALS();
    LOCK();
    while (GC_avail_descr + nwords >= GC_ed_size) {
       ext_descr * new;
       size_t new_size;
       word ed_size = GC_ed_size;
       
       UNLOCK();
        ENABLE_SIGNALS();
       if (ed_size == 0) {
           new_size = ED_INITIAL_SIZE;
       } else {
           new_size = 2 * ed_size;
           if (new_size > MAX_ENV) return(-1);
       } 
       new = (ext_descr *) GC_malloc_atomic(new_size * sizeof(ext_descr));
       if (new == 0) return(-1);
       DISABLE_SIGNALS();
        LOCK();
        if (ed_size == GC_ed_size) {
            if (GC_avail_descr != 0) {
               BCOPY(GC_ext_descriptors, new,
                     GC_avail_descr * sizeof(ext_descr));
           }
           GC_ed_size = new_size;
           GC_ext_descriptors = new;
       }  /* else another thread already resized it in the meantime */
    }
    result = GC_avail_descr;
    for (i = 0; i < nwords-1; i++) {
        GC_ext_descriptors[result + i].ed_bitmap = bm[i];
        GC_ext_descriptors[result + i].ed_continued = TRUE;
    }
    last_part = bm[i];
    /* Clear irrelevant bits. */
    extra_bits = nwords * WORDSZ - nbits;
    last_part <<= extra_bits;
    last_part >>= extra_bits;
    GC_ext_descriptors[result + i].ed_bitmap = last_part;
    GC_ext_descriptors[result + i].ed_continued = FALSE;
    GC_avail_descr += nwords;
    UNLOCK();
    ENABLE_SIGNALS();
    return(result);
}

Here is the caller graph for this function:

mse* GC_array_mark_proc ( word addr,
mse mark_stack_ptr,
mse mark_stack_limit,
word  env 
)

Definition at line 527 of file typd_mlc.c.

{
    register hdr * hhdr = HDR(addr);
    register word sz = hhdr -> hb_sz;
    register complex_descriptor * descr = (complex_descriptor *)(addr[sz-1]);
    mse * orig_mark_stack_ptr = mark_stack_ptr;
    mse * new_mark_stack_ptr;
    
    if (descr == 0) {
       /* Found a reference to a free list entry.  Ignore it. */
       return(orig_mark_stack_ptr);
    }
    /* In use counts were already updated when array descriptor was   */
    /* pushed.  Here we only replace it by subobject descriptors, so  */
    /* no update is necessary.                                        */
    new_mark_stack_ptr = GC_push_complex_descriptor(addr, descr,
                                              mark_stack_ptr,
                                              mark_stack_limit-1);
    if (new_mark_stack_ptr == 0) {
       /* Doesn't fit.  Conservatively push the whole array as a unit */
       /* and request a mark stack expansion.                         */
       /* This cannot cause a mark stack overflow, since it replaces  */
       /* the original array entry.                                   */
       GC_mark_stack_too_small = TRUE;
       new_mark_stack_ptr = orig_mark_stack_ptr + 1;
       new_mark_stack_ptr -> mse_start = addr;
       new_mark_stack_ptr -> mse_descr = WORDS_TO_BYTES(sz) | GC_DS_LENGTH;
    } else {
        /* Push descriptor itself */
        new_mark_stack_ptr++;
        new_mark_stack_ptr -> mse_start = addr + sz - 1;
        new_mark_stack_ptr -> mse_descr = sizeof(word) | GC_DS_LENGTH;
    }
    return(new_mark_stack_ptr);
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* GC_calloc_explicitly_typed ( size_t  n,
size_t  lb,
GC_descr  d 
)

Definition at line 723 of file typd_mlc.c.

{
register ptr_t op;
register ptr_t * opp;
register word lw;
GC_descr simple_descr;
complex_descriptor *complex_descr;
register int descr_type;
struct LeafDescriptor leaf;
DCL_LOCK_STATE;

    descr_type = GC_make_array_descriptor((word)n, (word)lb, d,
                                     &simple_descr, &complex_descr, &leaf);
    switch(descr_type) {
       case NO_MEM: return(0);
       case SIMPLE: return(GC_malloc_explicitly_typed(n*lb, simple_descr));
       case LEAF:
           lb *= n;
           lb += sizeof(struct LeafDescriptor) + TYPD_EXTRA_BYTES;
           break;
       case COMPLEX:
           lb *= n;
           lb += TYPD_EXTRA_BYTES;
           break;
    }
    if( SMALL_OBJ(lb) ) {
#       ifdef MERGE_SIZES
         lw = GC_size_map[lb];
#      else
         lw = ALIGNED_WORDS(lb);
#       endif
       opp = &(GC_arobjfreelist[lw]);
       FASTLOCK();
        if( !FASTLOCK_SUCCEEDED() || (op = *opp) == 0 ) {
            FASTUNLOCK();
            op = (ptr_t)GENERAL_MALLOC((word)lb, GC_array_kind);
           if (0 == op) return(0);
#          ifdef MERGE_SIZES
              lw = GC_size_map[lb];       /* May have been uninitialized.    */            
#          endif
        } else {
            *opp = obj_link(op);
           obj_link(op) = 0;
            GC_words_allocd += lw;
            FASTUNLOCK();
        }
   } else {
       op = (ptr_t)GENERAL_MALLOC((word)lb, GC_array_kind);
       if (0 == op) return(0);
       lw = BYTES_TO_WORDS(GC_size(op));
   }
   if (descr_type == LEAF) {
       /* Set up the descriptor inside the object itself. */
       VOLATILE struct LeafDescriptor * lp =
           (struct LeafDescriptor *)
               ((word *)op
                + lw - (BYTES_TO_WORDS(sizeof(struct LeafDescriptor)) + 1));
                
       lp -> ld_tag = LEAF_TAG;
       lp -> ld_size = leaf.ld_size;
       lp -> ld_nelements = leaf.ld_nelements;
       lp -> ld_descriptor = leaf.ld_descriptor;
       ((VOLATILE word *)op)[lw - 1] = (word)lp;
   } else {
       extern unsigned GC_finalization_failures;
       unsigned ff = GC_finalization_failures;
       
       ((word *)op)[lw - 1] = (word)complex_descr;
       /* Make sure the descriptor is cleared once there is any danger       */
       /* it may have been collected.                                 */
       (void)
         GC_general_register_disappearing_link((GC_PTR *)
                                            ((word *)op+lw-1),
                                                    (GC_PTR) op);
       if (ff != GC_finalization_failures) {
          /* Couldn't register it due to lack of memory.  Punt.       */
          /* This will probably fail too, but gives the recovery code  */
          /* a chance.                                                */
          return(GC_malloc(n*lb));
       }                              
   }
   return((GC_PTR) op);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 442 of file typd_mlc.c.

{
    switch(d -> TAG) {
      case LEAF_TAG:
       return(d -> ld.ld_nelements * d -> ld.ld_size);
      case ARRAY_TAG:
        return(d -> ad.ad_nelements
               * GC_descr_obj_size(d -> ad.ad_element_descr));
      case SEQUENCE_TAG:
        return(GC_descr_obj_size(d -> sd.sd_first)
               + GC_descr_obj_size(d -> sd.sd_second));
      default:
        ABORT("Bad complex descriptor");
        /*NOTREACHED*/ return 0; /*NOTREACHED*/
    }
}

Here is the caller graph for this function:

GC_descr GC_double_descr ( GC_descr  descriptor,
word  nwords 
)

Definition at line 169 of file typd_mlc.c.

{
    if ((descriptor & GC_DS_TAGS) == GC_DS_LENGTH) {
        descriptor = GC_bm_table[BYTES_TO_WORDS((word)descriptor)];
    };
    descriptor |= (descriptor & ~GC_DS_TAGS) >> nwords;
    return(descriptor);
}

Here is the caller graph for this function:

Definition at line 352 of file typd_mlc.c.

{
    register int i;
    DCL_LOCK_STATE;

    
#   ifdef PRINTSTATS
       if (sizeof(struct LeafDescriptor) % sizeof(word) != 0)
           ABORT("Bad leaf descriptor size");
#   endif
    DISABLE_SIGNALS();
    LOCK();
    if (GC_explicit_typing_initialized) {
      UNLOCK();
      ENABLE_SIGNALS();
      return;
    }
    GC_explicit_typing_initialized = TRUE;
    /* Set up object kind with simple indirect descriptor. */
      GC_eobjfreelist = (ptr_t *)GC_new_free_list_inner();
      GC_explicit_kind = GC_new_kind_inner(
                         (void **)GC_eobjfreelist,
                         (((word)WORDS_TO_BYTES(-1)) | GC_DS_PER_OBJECT),
                         TRUE, TRUE);
              /* Descriptors are in the last word of the object. */
      GC_typed_mark_proc_index = GC_new_proc_inner(GC_typed_mark_proc);
    /* Set up object kind with array descriptor. */
      GC_arobjfreelist = (ptr_t *)GC_new_free_list_inner();
      GC_array_mark_proc_index = GC_new_proc_inner(GC_array_mark_proc);
      GC_array_kind = GC_new_kind_inner(
                         (void **)GC_arobjfreelist,
                         GC_MAKE_PROC(GC_array_mark_proc_index, 0),
                         FALSE, TRUE);
      for (i = 0; i < WORDSZ/2; i++) {
          GC_descr d = (((word)(-1)) >> (WORDSZ - i)) << (WORDSZ - i);
          d |= GC_DS_BITMAP;
          GC_bm_table[i] = d;
      }
    UNLOCK();
    ENABLE_SIGNALS();
}

Here is the call graph for this function:

Here is the caller graph for this function:

int GC_make_array_descriptor ( word  nelements,
word  size,
GC_descr  descriptor,
GC_descr simple_d,
complex_descriptor **  complex_d,
struct LeafDescriptor *  leaf 
)

Definition at line 201 of file typd_mlc.c.

{
#   define OPT_THRESHOLD 50
       /* For larger arrays, we try to combine descriptors of adjacent       */
       /* descriptors to speed up marking, and to reduce the amount   */
       /* of space needed on the mark stack.                          */
    if ((descriptor & GC_DS_TAGS) == GC_DS_LENGTH) {
      if ((word)descriptor == size) {
       *simple_d = nelements * descriptor;
       return(SIMPLE);
      } else if ((word)descriptor == 0) {
        *simple_d = (GC_descr)0;
        return(SIMPLE);
      }
    }
    if (nelements <= OPT_THRESHOLD) {
      if (nelements <= 1) {
        if (nelements == 1) {
            *simple_d = descriptor;
            return(SIMPLE);
        } else {
            *simple_d = (GC_descr)0;
            return(SIMPLE);
        }
      }
    } else if (size <= BITMAP_BITS/2
              && (descriptor & GC_DS_TAGS) != GC_DS_PROC
              && (size & (sizeof(word)-1)) == 0) {
      int result =      
          GC_make_array_descriptor(nelements/2, 2*size,
                               GC_double_descr(descriptor,
                                             BYTES_TO_WORDS(size)),
                               simple_d, complex_d, leaf);
      if ((nelements & 1) == 0) {
          return(result);
      } else {
          struct LeafDescriptor * one_element =
              (struct LeafDescriptor *)
              GC_malloc_atomic(sizeof(struct LeafDescriptor));
          
          if (result == NO_MEM || one_element == 0) return(NO_MEM);
          one_element -> ld_tag = LEAF_TAG;
          one_element -> ld_size = size;
          one_element -> ld_nelements = 1;
          one_element -> ld_descriptor = descriptor;
          switch(result) {
            case SIMPLE:
            {
              struct LeafDescriptor * beginning =
                (struct LeafDescriptor *)
                GC_malloc_atomic(sizeof(struct LeafDescriptor));
              if (beginning == 0) return(NO_MEM);
              beginning -> ld_tag = LEAF_TAG;
              beginning -> ld_size = size;
              beginning -> ld_nelements = 1;
              beginning -> ld_descriptor = *simple_d;
              *complex_d = GC_make_sequence_descriptor(
                                   (complex_descriptor *)beginning,
                                   (complex_descriptor *)one_element);
              break;
            }
            case LEAF:
            {
              struct LeafDescriptor * beginning =
                (struct LeafDescriptor *)
                GC_malloc_atomic(sizeof(struct LeafDescriptor));
              if (beginning == 0) return(NO_MEM);
              beginning -> ld_tag = LEAF_TAG;
              beginning -> ld_size = leaf -> ld_size;
              beginning -> ld_nelements = leaf -> ld_nelements;
              beginning -> ld_descriptor = leaf -> ld_descriptor;
              *complex_d = GC_make_sequence_descriptor(
                                   (complex_descriptor *)beginning,
                                   (complex_descriptor *)one_element);
              break;
            }
            case COMPLEX:
              *complex_d = GC_make_sequence_descriptor(
                                   *complex_d,
                                   (complex_descriptor *)one_element);
              break;
          }
          return(COMPLEX);
      }
    }
    {
        leaf -> ld_size = size;
        leaf -> ld_nelements = nelements;
        leaf -> ld_descriptor = descriptor;
        return(LEAF);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

GC_descr GC_make_descriptor ( GC_bitmap  bm,
size_t  len 
)

Definition at line 571 of file typd_mlc.c.

{
    register signed_word last_set_bit = len - 1;
    register word result;
    register int i;
#   define HIGH_BIT (((word)1) << (WORDSZ - 1))
    
    if (!GC_explicit_typing_initialized) GC_init_explicit_typing();
    while (last_set_bit >= 0 && !GC_get_bit(bm, last_set_bit)) last_set_bit --;
    if (last_set_bit < 0) return(0 /* no pointers */);
#   if ALIGNMENT == CPP_WORDSZ/8
    {
      register GC_bool all_bits_set = TRUE;
      for (i = 0; i < last_set_bit; i++) {
       if (!GC_get_bit(bm, i)) {
           all_bits_set = FALSE;
           break;
       }
      }
      if (all_bits_set) {
       /* An initial section contains all pointers.  Use length descriptor. */
        return(WORDS_TO_BYTES(last_set_bit+1) | GC_DS_LENGTH);
      }
    }
#   endif
    if (last_set_bit < BITMAP_BITS) {
       /* Hopefully the common case.                    */
       /* Build bitmap descriptor (with bits reversed)  */
       result = HIGH_BIT;
       for (i = last_set_bit - 1; i >= 0; i--) {
           result >>= 1;
           if (GC_get_bit(bm, i)) result |= HIGH_BIT;
       }
       result |= GC_DS_BITMAP;
       return(result);
    } else {
       signed_word index;
       
       index = GC_add_ext_descriptor(bm, (word)last_set_bit+1);
       if (index == -1) return(WORDS_TO_BYTES(last_set_bit+1) | GC_DS_LENGTH);
                            /* Out of memory: use conservative */
                            /* approximation.                  */
       result = GC_MAKE_PROC(GC_typed_mark_proc_index, (word)index);
       return(result);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 301 of file typd_mlc.c.

{
    struct SequenceDescriptor * result =
        (struct SequenceDescriptor *)
              GC_malloc(sizeof(struct SequenceDescriptor));
    /* Can't result in overly conservative marking, since tags are    */
    /* very small integers. Probably faster than maintaining type     */
    /* info.                                                   */    
    if (result != 0) {
       result -> sd_tag = SEQUENCE_TAG;
        result -> sd_first = first;
        result -> sd_second = second;
    }
    return((complex_descriptor *)result);
}
char* GC_malloc_explicitly_typed ( size_t  lb,
GC_descr  d 
)

Definition at line 632 of file typd_mlc.c.

{
register ptr_t op;
register ptr_t * opp;
register word lw;
DCL_LOCK_STATE;

    lb += TYPD_EXTRA_BYTES;
    if( SMALL_OBJ(lb) ) {
#       ifdef MERGE_SIZES
         lw = GC_size_map[lb];
#      else
         lw = ALIGNED_WORDS(lb);
#       endif
       opp = &(GC_eobjfreelist[lw]);
       FASTLOCK();
        if( !FASTLOCK_SUCCEEDED() || (op = *opp) == 0 ) {
            FASTUNLOCK();
            op = (ptr_t)GENERAL_MALLOC((word)lb, GC_explicit_kind);
           if (0 == op) return 0;
#          ifdef MERGE_SIZES
              lw = GC_size_map[lb];       /* May have been uninitialized.    */
#          endif
        } else {
            *opp = obj_link(op);
           obj_link(op) = 0;
            GC_words_allocd += lw;
            FASTUNLOCK();
        }
   } else {
       op = (ptr_t)GENERAL_MALLOC((word)lb, GC_explicit_kind);
       if (op != NULL)
           lw = BYTES_TO_WORDS(GC_size(op));
   }
   if (op != NULL)
       ((word *)op)[lw - 1] = d;
   return((GC_PTR) op);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 677 of file typd_mlc.c.

{
register ptr_t op;
register ptr_t * opp;
register word lw;
DCL_LOCK_STATE;

    lb += TYPD_EXTRA_BYTES;
    if( SMALL_OBJ(lb) ) {
#       ifdef MERGE_SIZES
         lw = GC_size_map[lb];
#      else
         lw = ALIGNED_WORDS(lb);
#       endif
       opp = &(GC_eobjfreelist[lw]);
       FASTLOCK();
        if( !FASTLOCK_SUCCEEDED() || (op = *opp) == 0 ) {
            FASTUNLOCK();
            op = (ptr_t)GENERAL_MALLOC_IOP(lb, GC_explicit_kind);
#          ifdef MERGE_SIZES
              lw = GC_size_map[lb];       /* May have been uninitialized.    */
#          endif
        } else {
            *opp = obj_link(op);
           obj_link(op) = 0;
            GC_words_allocd += lw;
            FASTUNLOCK();
        }
   } else {
       op = (ptr_t)GENERAL_MALLOC_IOP(lb, GC_explicit_kind);
       if (op != NULL)
       lw = BYTES_TO_WORDS(GC_size(op));
   }
   if (op != NULL)
       ((word *)op)[lw - 1] = d;
   return((GC_PTR) op);
}

Here is the call graph for this function:

mse* GC_typed_mark_proc GC_PROTO ( (register word *addr, register mse *mark_stack_ptr, mse *mark_stack_limit, word env )
mse* GC_push_complex_descriptor ( word addr,
complex_descriptor d,
mse msp,
mse msl 
)

Definition at line 462 of file typd_mlc.c.

{
    register ptr_t current = (ptr_t) addr;
    register word nelements;
    register word sz;
    register word i;
    
    switch(d -> TAG) {
      case LEAF_TAG:
        {
          register GC_descr descr = d -> ld.ld_descriptor;
          
          nelements = d -> ld.ld_nelements;
          if (msl - msp <= (ptrdiff_t)nelements) return(0);
          sz = d -> ld.ld_size;
          for (i = 0; i < nelements; i++) {
              msp++;
              msp -> mse_start = (word *)current;
              msp -> mse_descr = descr;
              current += sz;
          }
          return(msp);
        }
      case ARRAY_TAG:
        {
          register complex_descriptor *descr = d -> ad.ad_element_descr;
          
          nelements = d -> ad.ad_nelements;
          sz = GC_descr_obj_size(descr);
          for (i = 0; i < nelements; i++) {
              msp = GC_push_complex_descriptor((word *)current, descr,
                                                 msp, msl);
              if (msp == 0) return(0);
              current += sz;
          }
          return(msp);
        }
      case SEQUENCE_TAG:
        {
          sz = GC_descr_obj_size(d -> sd.sd_first);
          msp = GC_push_complex_descriptor((word *)current, d -> sd.sd_first,
                                      msp, msl);
          if (msp == 0) return(0);
          current += sz;
          msp = GC_push_complex_descriptor((word *)current, d -> sd.sd_second,
                                      msp, msl);
          return(msp);
        }
      default:
        ABORT("Bad complex descriptor");
        /*NOTREACHED*/ return 0; /*NOTREACHED*/
   }
}

Here is the call graph for this function:

Here is the caller graph for this function:

mse* GC_typed_mark_proc ( word addr,
mse mark_stack_ptr,
mse mark_stack_limit,
word  env 
)

Definition at line 400 of file typd_mlc.c.

{
    register word bm = GC_ext_descriptors[env].ed_bitmap;
    register word * current_p = addr;
    register word current;
    register ptr_t greatest_ha = GC_greatest_plausible_heap_addr;
    register ptr_t least_ha = GC_least_plausible_heap_addr;
    
    for (; bm != 0; bm >>= 1, current_p++) {
       if (bm & 1) {
           current = *current_p;
           FIXUP_POINTER(current);
           if ((ptr_t)current >= least_ha && (ptr_t)current <= greatest_ha) {
               PUSH_CONTENTS((ptr_t)current, mark_stack_ptr,
                           mark_stack_limit, current_p, exit1);
           }
       }
    }
    if (GC_ext_descriptors[env].ed_continued) {
        /* Push an entry with the rest of the descriptor back onto the       */
        /* stack.  Thus we never do too much work at once.  Note that */
        /* we also can't overflow the mark stack unless we actually   */
        /* mark something.                                     */
        mark_stack_ptr++;
        if (mark_stack_ptr >= mark_stack_limit) {
            mark_stack_ptr = GC_signal_mark_stack_overflow(mark_stack_ptr);
        }
        mark_stack_ptr -> mse_start = addr + WORDSZ;
        mark_stack_ptr -> mse_descr =
              GC_MAKE_PROC(GC_typed_mark_proc_index, env+1);
    }
    return(mark_stack_ptr);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 339 of file typd_mlc.c.

Definition at line 49 of file typd_mlc.c.

Definition at line 98 of file typd_mlc.c.

Definition at line 95 of file typd_mlc.c.

Definition at line 162 of file typd_mlc.c.

Definition at line 92 of file typd_mlc.c.

Definition at line 337 of file typd_mlc.c.

Definition at line 46 of file typd_mlc.c.

Definition at line 44 of file typd_mlc.c.

Definition at line 89 of file typd_mlc.c.

Definition at line 97 of file typd_mlc.c.