/[guile]/guile/guile-core/libguile/goops.c
ViewVC logotype

Diff of /guile/guile-core/libguile/goops.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.44 by dirk, Thu Jan 10 20:52:44 2002 UTC revision 1.45 by mvo, Mon Feb 11 18:06:49 2002 UTC
# Line 495  SCM_DEFINE (scm_sys_prep_layout_x, "%pre Line 495  SCM_DEFINE (scm_sys_prep_layout_x, "%pre
495      SCM_MISC_ERROR ("class object doesn't have enough fields: ~S",      SCM_MISC_ERROR ("class object doesn't have enough fields: ~S",
496                      scm_list_1 (nfields));                      scm_list_1 (nfields));
497        
498    s = n > 0 ? scm_must_malloc (n, FUNC_NAME) : 0;    s = n > 0 ? scm_malloc (n) : 0;
499    for (i = 0; i < n; i += 2)    for (i = 0; i < n; i += 2)
500      {      {
501        long len;        long len;
# Line 544  SCM_DEFINE (scm_sys_prep_layout_x, "%pre Line 544  SCM_DEFINE (scm_sys_prep_layout_x, "%pre
544      }      }
545    SCM_SET_SLOT (class, scm_si_layout, scm_mem2symbol (s, n));    SCM_SET_SLOT (class, scm_si_layout, scm_mem2symbol (s, n));
546    if (s)    if (s)
547      scm_must_free (s);      free (s);
548    return SCM_UNSPECIFIED;    return SCM_UNSPECIFIED;
549  }  }
550  #undef FUNC_NAME  #undef FUNC_NAME
# Line 577  SCM_DEFINE (scm_sys_inherit_magic_x, "%i Line 577  SCM_DEFINE (scm_sys_inherit_magic_x, "%i
577        long n = SCM_INUM (SCM_SLOT (class, scm_si_nfields));        long n = SCM_INUM (SCM_SLOT (class, scm_si_nfields));
578  #if 0  #if 0
579        /*        /*
580         * We could avoid calling scm_must_malloc in the allocation code         * We could avoid calling scm_gc_malloc in the allocation code
581         * (in which case the following two lines are needed).  Instead         * (in which case the following two lines are needed).  Instead
582         * we make 0-slot instances non-light, so that the light case         * we make 0-slot instances non-light, so that the light case
583         * can be handled without special cases.         * can be handled without special cases.
# Line 1326  SCM_DEFINE (scm_sys_allocate_instance, " Line 1326  SCM_DEFINE (scm_sys_allocate_instance, "
1326    if (SCM_CLASS_FLAGS (class) & SCM_STRUCTF_LIGHT)    if (SCM_CLASS_FLAGS (class) & SCM_STRUCTF_LIGHT)
1327      {      {
1328        n = SCM_INUM (SCM_SLOT (class, scm_si_nfields));        n = SCM_INUM (SCM_SLOT (class, scm_si_nfields));
1329        m = (SCM *) scm_must_malloc (n * sizeof (SCM), "instance");        m = (SCM *) scm_gc_malloc (n * sizeof (SCM), "struct");
1330        return wrap_init (class, m, n);        return wrap_init (class, m, n);
1331      }      }
1332        
# Line 1339  SCM_DEFINE (scm_sys_allocate_instance, " Line 1339  SCM_DEFINE (scm_sys_allocate_instance, "
1339    /* Entities */    /* Entities */
1340    if (SCM_CLASS_FLAGS (class) & SCM_CLASSF_ENTITY)    if (SCM_CLASS_FLAGS (class) & SCM_CLASSF_ENTITY)
1341      {      {
1342        m = (SCM *) scm_alloc_struct (n,        m = (SCM *) scm_alloc_struct (n, scm_struct_entity_n_extra_words,
1343                                      scm_struct_entity_n_extra_words,                                      "entity struct");
                                     "entity");  
1344        m[scm_struct_i_setter] = SCM_BOOL_F;        m[scm_struct_i_setter] = SCM_BOOL_F;
1345        m[scm_struct_i_procedure] = SCM_BOOL_F;        m[scm_struct_i_procedure] = SCM_BOOL_F;
1346        /* Generic functions */        /* Generic functions */
# Line 1377  SCM_DEFINE (scm_sys_allocate_instance, " Line 1376  SCM_DEFINE (scm_sys_allocate_instance, "
1376        
1377    /* Non-light instances */    /* Non-light instances */
1378    {    {
1379      m = (SCM *) scm_alloc_struct (n,      m = (SCM *) scm_alloc_struct (n, scm_struct_n_extra_words, "heavy struct");
                                   scm_struct_n_extra_words,  
                                   "heavy instance");  
1380      return wrap_init (class, m, n);      return wrap_init (class, m, n);
1381    }    }
1382  }  }
# Line 1504  go_to_hell (void *o) Line 1501  go_to_hell (void *o)
1501    if (n_hell == hell_size)    if (n_hell == hell_size)
1502      {      {
1503        long new_size = 2 * hell_size;        long new_size = 2 * hell_size;
1504        hell = scm_must_realloc (hell, hell_size, new_size, "hell");        hell = scm_realloc (hell, new_size);
1505        hell_size = new_size;        hell_size = new_size;
1506      }      }
1507    hell[n_hell++] = SCM_STRUCT_DATA (obj);    hell[n_hell++] = SCM_STRUCT_DATA (obj);
# Line 2683  scm_init_goops_builtins (void) Line 2680  scm_init_goops_builtins (void)
2680    
2681    list_of_no_method = scm_permanent_object (scm_list_1 (sym_no_method));    list_of_no_method = scm_permanent_object (scm_list_1 (sym_no_method));
2682    
2683    hell = scm_must_malloc (hell_size, "hell");    hell = scm_malloc (hell_size);
2684  #ifdef USE_THREADS  #ifdef USE_THREADS
2685    scm_mutex_init (&hell_mutex);    scm_mutex_init (&hell_mutex);
2686  #endif  #endif

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26