Changeset 12152 in project


Ignore:
Timestamp:
10/14/08 10:39:25 (12 years ago)
Author:
felix winkelmann
Message:

fixes in cscbench; removed lockts feature

Location:
chicken/branches/cmi
Files:
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • chicken/branches/cmi/benchmarks/cscbench.scm

    r12140 r12152  
    77(define flonum-files '("fft" "maze"))
    88
    9 (define cc "`../csc -cc-name`")
    10 (define chicken "../chicken")
     9(define cc "`csc -cc-name`")
     10(define chicken "chicken")
    1111
    1212(define (abort-run) #f)
     
    8787      (system* "~A -v" cc) )
    8888  (dflush "\nCFLAGS:\n")
    89   (system* "echo `../csc -cflags`")
    90   (display "\n                  base       unsafe     max\n")
     89  (system* "echo `csc -cflags`")
     90  (display "\n                     base     unsafe        max\n")
    9191  (let ((sum-base 0.0)
    9292        (sum-unsafe 0.0)
     
    106106       (newline)
    107107       (flush-output) ) )
    108    (lset-difference string=? (sort (glob "*.scm") string<?) '("plists.scm")))
     108   (lset-difference string=? (sort (glob "*.scm") string<?) '("cscbench.scm")))
    109109  (display "\nTOTAL            ")
    110110  (display-f-4.3 sum-base)
  • chicken/branches/cmi/distribution/manifest

    r12117 r12152  
    99banner.scm
    1010batch-driver.scm
     11benchmarks/cscbench.scm
    1112benchmarks/boyer.scm
    1213benchmarks/browse.scm
     
    110111csc.1
    111112csc.scm
    112 cscbench.scm
    113113csi.1
    114114csi.scm
  • chicken/branches/cmi/library.scm

    r11989 r12152  
    32493249                   (if (##sys#fudge 32) " gchooks" "")
    32503250                   (if (##sys#fudge 35) " applyhook" "")
    3251                    (if (##sys#fudge 22) " lockts" "")
    32523251                   (if (##sys#fudge 37) " hostpcre" "")
    32533252                   (if (##sys#fudge 39) " cross" "") ) ) )
  • chicken/branches/cmi/rules.make

    r12151 r12152  
    13931393
    13941394bench:
    1395         here=`pwd`; cd $(SRCDIR)benchmark; \
    1396         LD_LIBRARY_PATH=$$here DYLD_LIBRARY_PATH=$$here \
    1397         $$here/csi -s $(SRCDIR)cscbench.scm $(BENCHMARK_OPTIONS)
     1395        here=`pwd`; \
     1396        cd $(SRCDIR)benchmarks; \
     1397        LD_LIBRARY_PATH=$$here DYLD_LIBRARY_PATH=$$here PATH=$$here:$$PATH \
     1398        csi -s cscbench.scm $(BENCHMARK_OPTIONS)
  • chicken/branches/cmi/runtime.c

    r12021 r12152  
    148148#if defined(C_NO_HACKED_APPLY) && defined(C_HACKED_APPLY)
    149149# undef C_HACKED_APPLY
    150 #endif
    151 
    152 #ifdef C_LOCK_TOSPACE
    153 #include <sys/mman.h>
    154150#endif
    155151
     
    529525static C_word get_unbound_variable_value(C_word sym);
    530526static LF_LIST *find_module_handle(C_char *name);
    531 static void lock_tospace(int lock);
    532527
    533528static C_ccall void call_cc_wrapper(C_word c, C_word closure, C_word k, C_word result) C_noret;
     
    658653    return 0;
    659654
    660 #ifdef C_LOCK_TOSPACE
    661   page_size = sysconf(_SC_PAGESIZE);
    662   assert(page_size > -1);
    663 #else
    664655  page_size = 0;
    665 #endif
    666656  stack_size = stack ? stack : DEFAULT_STACK_SIZE;
    667657  C_set_or_change_heap_size(heap ? heap : DEFAULT_HEAP_SIZE, 0);
     
    10371027/* Align memory to page boundary */
    10381028
    1039 #ifndef C_LOCK_TOSPACE
    10401029static void *align_to_page(void *mem)
    10411030{
    10421031  return (void *)C_align((C_uword)mem);
    10431032}
    1044 #endif
     1033
    10451034
    10461035static C_byte *
     
    10481037{
    10491038  C_byte *p;
    1050 #ifdef C_LOCK_TOSPACE
    1051   p = (C_byte *)mmap (NULL, size, (PROT_READ | PROT_WRITE),
    1052                       (MAP_PRIVATE | MAP_ANON), -1, 0);
    1053   if (p != NULL && page_aligned) *page_aligned = p;
    1054 #else
    10551039  p = (C_byte *)C_malloc (size + page_size);
     1040
    10561041  if (p != NULL && page_aligned) *page_aligned = align_to_page (p);
    1057 #endif
    1058 
    1059   /* . */
     1042
    10601043  return p;
    10611044}
     1045
    10621046
    10631047static void
    10641048heap_free (C_byte *ptr, size_t size)
    10651049{
    1066 #ifdef C_LOCK_TOSPACE
    1067   int r = munmap (ptr, size);
    1068   assert (r == 0);
    1069 #else
    10701050  C_free (ptr);
    1071 #endif
    1072   /* . */
    1073 }
     1051}
     1052
    10741053
    10751054static C_byte *
     
    10781057{
    10791058  C_byte *p;
    1080 #ifdef C_LOCK_TOSPACE
    1081   p = (C_byte *)mmap (NULL, new_size, (PROT_READ | PROT_WRITE),
    1082                       (MAP_PRIVATE | MAP_ANON), -1, 0);
    1083   if (ptr != NULL) {
    1084     memcpy (p, ptr, old_size);
    1085     heap_free (ptr, old_size);
    1086   }
    1087   if (p != NULL && page_aligned) *page_aligned = p;
    1088 #else
    10891059  p = (C_byte *)C_realloc (ptr, new_size + page_size);
     1060
    10901061  if (p != NULL && page_aligned) *page_aligned = align_to_page (p);
    1091 #endif
    1092 
    1093   /* . */
     1062
    10941063  return p;
    10951064}
     1065
    10961066
    10971067/* Modify heap size at runtime: */
     
    11271097  tospace_limit = tospace_start + size;
    11281098  mutation_stack_top = mutation_stack_bottom;
    1129   lock_tospace(1);
    11301099
    11311100  if(reintern) initialize_symbol_table();
     
    27082677
    27092678
    2710 static void lock_tospace(int lock)
    2711 {
    2712 #ifdef C_LOCK_TOSPACE
    2713   int r;
    2714 
    2715   r = mprotect(tospace_start, (heap_size / 2),
    2716                lock ? PROT_NONE : (PROT_READ | PROT_WRITE));
    2717 
    2718   if(r == -1) panic(strerror(errno));
    2719 #endif
    2720 }
    2721 
    2722 
    27232679C_regparm void C_fcall C_reclaim(void *trampoline, void *proc)
    27242680{
     
    27462702  if(C_pre_gc_hook != NULL) C_pre_gc_hook(GC_MINOR);
    27472703
    2748   lock_tospace(0);
    27492704  finalizers_checked = 0;
    27502705  C_restart_trampoline = (TRAMPOLINE)trampoline;
     
    30152970  if(C_post_gc_hook != NULL) C_post_gc_hook(gc_mode, tgc);
    30162971
    3017   lock_tospace(1);
    30182972  /* Jump from the Empire State Building... */
    30192973  C_longjmp(C_restart, 1);
     
    31953149  size_t  new_heapspace_size;
    31963150
    3197   lock_tospace(0);
    3198 
    31993151  if(C_pre_gc_hook != NULL) C_pre_gc_hook(GC_REALLOC);
    32003152
     
    33233275  C_fromspace_top = new_tospace_top;
    33243276  C_fromspace_limit = new_tospace_limit;
    3325   lock_tospace(1);
    33263277
    33273278  if(gc_report_flag) {
     
    41934144    return C_fix(C_MOST_POSITIVE_FIXNUM);
    41944145
    4195   case C_fix(22):
    4196 #ifdef C_LOCK_TOSPACE
    4197     return C_SCHEME_TRUE;
    4198 #else
    4199     return C_SCHEME_FALSE;
    4200 #endif
     4146    /* 22 */
    42014147
    42024148  case C_fix(23):
Note: See TracChangeset for help on using the changeset viewer.