コード例 #1
0
ファイル: simul_efun.c プロジェクト: Fuchur/ldmud
/*-------------------------------------------------------------------------*/
void
count_simul_efun_refs (void)

/* GC support: count the references of all memory held by the module.
 */

{
    if (simul_efun_file_name)
        count_ref_from_string(simul_efun_file_name);

    if (simul_efunp)
    {
        int i;

        note_malloced_block_ref((char *)simul_efunp);
        for (i = num_simul_efun; --i >= 0; )
            count_ref_from_string(simul_efunp[i].name);
    }

    if (simul_efun_vector && !simul_efun_vector->ref++)
    {
        note_malloced_block_ref((char *)simul_efun_vector);
        count_ref_in_vector(
          simul_efun_vector->item,
          VEC_SIZE(simul_efun_vector)
        );
    }
    if (simul_efun_program)
        mark_program_ref(simul_efun_program);
} /* count_simul_efun_refs() */
コード例 #2
0
ファイル: wiz_list.c プロジェクト: bobalu113/gabbo
/*-------------------------------------------------------------------------*/
void
count_ref_from_wiz_list (void)

/* GC support: Count the refs for the wiz_list memory.
 */

{
    wiz_list_t *w;

    for (w = all_wiz; w; w = w->next) {
        count_ref_from_string(w->name);
        count_ref_in_vector(&w->extra, 1);
        if(w->file_name)
            count_ref_from_string(w->file_name);
        if (w->error_message)
            count_ref_from_string(w->error_message);
        note_malloced_block_ref((char *)w);
    }
    count_ref_in_vector(&default_wizlist_entry.extra, 1);
} /* count_ref_from_wiz_list() */
コード例 #3
0
ファイル: structs.c プロジェクト: Shea690901/ldmud
/*-------------------------------------------------------------------------*/
void
count_struct_ref (struct_t * pStruct)

/* Count all references held by struct <pStruct>
 */

{
    pStruct->ref++;
    if (test_memory_reference(pStruct))
    {
        note_malloced_block_ref(pStruct);
        count_struct_type_ref(pStruct->type);
        if (struct_size(pStruct))
        {
            count_ref_in_vector(pStruct->member, struct_size(pStruct));
        }
    }
} /* count_struct_ref() */