Changeset 15090


Ignore:
Timestamp:
Nov 23, 2011, 9:55:08 PM (8 years ago)
Author:
rme
Message:

New functions ptr_in_area() and in_any_consing_area().

Location:
trunk/source/lisp-kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/x86-utils.c

    r14991 r15090  
    5252  return disp;
    5353}
     54
     55int
     56ptr_in_area(char *p, area *a)
     57{
     58  return a->low <= p && a->high > p;
     59}
     60
     61area *
     62in_any_consing_area(LispObj thing)
     63{
     64  area *a = all_areas->succ;
     65  char *p = (char *)thing;
     66
     67  while (a != all_areas) {
     68    area_code code = a->code;
     69    if (code == AREA_READONLY || code == AREA_WATCHED ||
     70        code == AREA_MANAGED_STATIC || code == AREA_STATIC ||
     71        code == AREA_DYNAMIC) {
     72      if (a->low <= p && p < a->high)
     73        return a;
     74    }
     75    a = a->succ;
     76  }
     77  return NULL;
     78}
  • trunk/source/lisp-kernel/x86-utils.h

    r14991 r15090  
    2020extern LispObj tra_function(LispObj tra);
    2121extern int tra_offset(LispObj tra);
     22extern int ptr_in_area(char *p, area* a);
     23extern area *in_any_consing_area(LispObj thing);
    2224
    2325static inline LispObj
Note: See TracChangeset for help on using the changeset viewer.