~ubuntu-branches/ubuntu/intrepid/ecl/intrepid

« back to all changes in this revision

Viewing changes to src/gc/dyn_load.c

  • Committer: Bazaar Package Importer
  • Author(s): Peter Van Eynde
  • Date: 2006-06-21 09:21:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060621092121-txz1f21lj0wh0f67
Tags: 0.9h-20060617-1
* New upstream version
* Updated standards version without real changes. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
776
776
  /* this automatically, and rely largely on user input.        */
777
777
  /* We expect that any mapping with type MEM_MAPPED (which     */
778
778
  /* apparently excludes library data sections) can be safely   */
779
 
  /* ignored.  But we're too chicken to do that in this         */
780
 
  /* version.                                                   */
 
779
  /* ignored.  But we're too completely remove this code in     */
 
780
  /* this version.                                              */
781
781
  /* Based on a very limited sample, it appears that:           */
782
782
  /*    - Frame buffer mappings appear as mappings of large     */
783
783
  /*      length, usually a bit less than a power of two.       */
844
844
  }
845
845
# endif /* DEBUG_VIRTUALQUERY */
846
846
 
 
847
  extern GC_bool GC_wnt;  /* Is Windows NT derivative.          */
 
848
                          /* Defined and set in os_dep.c.       */
 
849
 
847
850
  void GC_register_dynamic_libraries()
848
851
  {
849
852
    MEMORY_BASIC_INFORMATION buf;
885
888
                 * !is_frame_buffer(p, buf.RegionSize, buf.Type)
886
889
                 * instead of just checking for MEM_IMAGE.
887
890
                 * If something breaks, change it back. */
888
 
                && buf.Type == MEM_IMAGE) {  
 
891
                /* There is some evidence that we cannot always
 
892
                 * ignore MEM_PRIVATE sections under Windows ME
 
893
                 * and predecessors.  Hence we now also check for
 
894
                 * that case.   */
 
895
                && (buf.Type == MEM_IMAGE ||
 
896
                    !GC_wnt && buf.Type == MEM_PRIVATE)) {  
889
897
#               ifdef DEBUG_VIRTUALQUERY
890
898
                  GC_dump_meminfo(&buf);
891
899
#               endif
1141
1149
static void GC_dyld_image_add(struct mach_header* hdr, unsigned long slide) {
1142
1150
    unsigned long start,end,i;
1143
1151
    const struct section *sec;
1144
 
    if (GC_no_dls)
1145
 
        return;
 
1152
    if (GC_no_dls) return;
1146
1153
    for(i=0;i<sizeof(GC_dyld_sections)/sizeof(GC_dyld_sections[0]);i++) {
1147
1154
        sec = getsectbynamefromheader(
1148
1155
            hdr,GC_dyld_sections[i].seg,GC_dyld_sections[i].sect);
1149
 
            if(sec == NULL || sec->size == 0) continue;
1150
 
            start = slide + sec->addr;
1151
 
            end = start + sec->size;
1152
 
#               ifdef DARWIN_DEBUG
1153
 
                GC_printf4("Adding section at %p-%p (%lu bytes) from image %s\n",
 
1156
        if(sec == NULL || sec->size == 0) continue;
 
1157
        start = slide + sec->addr;
 
1158
        end = start + sec->size;
 
1159
#       ifdef DARWIN_DEBUG
 
1160
            GC_printf4("Adding section at %p-%p (%lu bytes) from image %s\n",
1154
1161
                start,end,sec->size,GC_dyld_name_for_hdr(hdr));
1155
 
#                       endif
 
1162
#       endif
1156
1163
        GC_add_roots((char*)start,(char*)end);
1157
 
        }
1158
 
#       ifdef DARWIN_DEBUG
1159
 
    GC_print_static_roots();
1160
 
#       endif
 
1164
    }
 
1165
#   ifdef DARWIN_DEBUG
 
1166
        GC_print_static_roots();
 
1167
#   endif
1161
1168
}
1162
1169
 
1163
1170
/* This should never be called by a thread holding the lock */
1170
1177
        if(sec == NULL || sec->size == 0) continue;
1171
1178
        start = slide + sec->addr;
1172
1179
        end = start + sec->size;
1173
 
#               ifdef DARWIN_DEBUG
 
1180
#       ifdef DARWIN_DEBUG
1174
1181
            GC_printf4("Removing section at %p-%p (%lu bytes) from image %s\n",
1175
1182
                start,end,sec->size,GC_dyld_name_for_hdr(hdr));
1176
1183
#               endif
1177
1184
        GC_remove_roots((char*)start,(char*)end);
1178
1185
    }
1179
 
#       ifdef DARWIN_DEBUG
1180
 
    GC_print_static_roots();
1181
 
#       endif
 
1186
#   ifdef DARWIN_DEBUG
 
1187
        GC_print_static_roots();
 
1188
#   endif
1182
1189
}
1183
1190
 
1184
1191
void GC_register_dynamic_libraries() {