Changeset 9970


Ignore:
Timestamp:
Jul 10, 2008, 9:33:49 AM (11 years ago)
Author:
gb
Message:

Trunk changes (early WINDOWS conditionalization, int->natural.)
Remove some unused variables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/lisp-kernel/memory.c

    r7137 r9970  
    3232#endif
    3333
    34 
     34#ifndef WINDOWS
    3535#include <sys/mman.h>
     36#endif
    3637
    3738void
     
    3940{
    4041  char buf[64];
    41   sprintf(buf, "Can't allocate %s of size %d bytes.", pointerp ? "pointer" : "handle", size);
     42  sprintf(buf, "Can't allocate %s of size %ld bytes.", pointerp ? "pointer" : "handle", size);
    4243  Fatal(":   Kernel memory allocation failure.  ", buf);
    4344}
     
    7576
    7677int
    77 ProtectMemory(LogicalAddress addr, int nbytes)
     78ProtectMemory(LogicalAddress addr, natural nbytes)
    7879{
    7980  int status = mprotect(addr, nbytes, PROT_READ | PROT_EXEC);
     
    8788
    8889int
    89 UnProtectMemory(LogicalAddress addr, int nbytes)
     90UnProtectMemory(LogicalAddress addr, natural nbytes)
    9091{
    9192  return mprotect(addr, nbytes, PROT_READ|PROT_WRITE|PROT_EXEC);
     
    179180zero_memory_range(BytePtr start, BytePtr end)
    180181{
    181   bzero(start,end-start);
     182#ifdef WINDOWS
     183  ZeroMemory(start,end-start);
     184#else
     185  bzero(start,(size_t)(end-start));
     186#endif
    182187}
    183188
     
    195200                    natural free_space_size)
    196201{
    197   extern int page_size;
    198202  area *a = active_dynamic_area;
    199   BytePtr newlimit, protptr, zptr;
    200   int psize = page_size;
     203  BytePtr newlimit;
    201204  if (free_space_size) {
    202205    BytePtr lowptr = a->active;
     
    406409  BytePtr
    407410    curfree = a->active,
    408     target_low = target->low,
    409     tenured_low = tenured_area->low;
     411    target_low = target->low;
    410412  natural
    411     dynamic_dnodes = area_dnode(curfree, a->low),
    412413    new_tenured_dnodes = area_dnode(curfree, tenured_area->low);
    413414  bitvector
     
    491492    }
    492493    if (activate) {
    493       LispObj *heap_start = ptr_from_lispobj(lisp_global(HEAP_START));
    494 
    495494      a->older = g1_area;
    496495      tenure_to_area(tenured_area);
     
    611610}
    612611
     612#ifdef WINDOWS
     613void
     614release_readonly_area()
     615{
     616}
     617#else
     618void
     619release_readonly_area()
     620{
     621  area *a = readonly_area;
     622  munmap(a->low,align_to_power_of_2(a->active-a->low, log2_page_size));
     623  a->active = a->low;
     624  a->ndnodes = 0;
     625  pure_space_active = pure_space_start;
     626}
     627#endif
Note: See TracChangeset for help on using the changeset viewer.