(define-primitive-object (bignum :lowtag other-pointer-lowtag
:widetag bignum-widetag
:alloc-trans sb!bignum::%allocate-bignum)
- (digits :rest-p t :c-type #!-alpha "long" #!+alpha "u32"))
+ (digits :rest-p t :c-type #!-alpha "sword_t" #!+alpha "u32"))
(define-primitive-object (ratio :type ratio
:lowtag other-pointer-lowtag
}
lispobj
-alloc_number(long n)
+alloc_number(sword_t n)
{
struct bignum *ptr;
#include "gc-internal.h"
#ifdef LISP_FEATURE_GENCGC
-extern lispobj *general_alloc(long bytes, int page_type_flag);
+extern lispobj *general_alloc(sword_t bytes, int page_type_flag);
#endif
extern lispobj alloc_cons(lispobj car, lispobj cdr);
-extern lispobj alloc_number(long n);
+extern lispobj alloc_number(sword_t n);
extern lispobj alloc_string(char *str);
extern lispobj alloc_sap(void *ptr);
extern lispobj alloc_base_string(char *str);
struct ndir_entry {
#ifndef LISP_FEATURE_ALPHA
- long identifier;
- long nwords;
- long data_page;
- long address;
- long page_count;
+ sword_t identifier;
+ sword_t nwords;
+ sword_t data_page;
+ sword_t address;
+ sword_t page_count;
#else
u32 identifier;
u32 nwords;
FSHOW((stderr, "/process_directory(..), count=%d\n", count));
for (entry = (struct ndir_entry *) ptr; --count>= 0; ++entry) {
+
compressed = 0;
- long id = entry->identifier;
+ sword_t id = entry->identifier;
if (id <= (MAX_CORE_SPACE_ID | DEFLATED_CORE_SPACE_ID_FLAG)) {
if (id & DEFLATED_CORE_SPACE_ID_FLAG)
compressed = 1;
id &= ~(DEFLATED_CORE_SPACE_ID_FLAG);
}
- long offset = os_vm_page_size * (1 + entry->data_page);
+ sword_t offset = os_vm_page_size * (1 + entry->data_page);
os_vm_address_t addr =
(os_vm_address_t) (os_vm_page_size * entry->address);
lispobj *free_pointer = (lispobj *) addr + entry->nwords;
return newspace_copy;
}
-long (*scavtab[256])(lispobj *where, lispobj object);
+sword_t (*scavtab[256])(lispobj *where, lispobj object);
lispobj (*transother[256])(lispobj object);
-long (*sizetab[256])(lispobj *where);
+sword_t (*sizetab[256])(lispobj *where);
struct weak_pointer *weak_pointers;
os_vm_size_t bytes_consed_between_gcs = 12*1024*1024;
/* to copy a boxed object */
lispobj
-copy_object(lispobj object, long nwords)
+copy_object(lispobj object, sword_t nwords)
{
return gc_general_copy_object(object, nwords, BOXED_PAGE_FLAG);
}
lispobj
-copy_code_object(lispobj object, long nwords)
+copy_code_object(lispobj object, sword_t nwords)
{
return gc_general_copy_object(object, nwords, CODE_PAGE_FLAG);
}
-static long scav_lose(lispobj *where, lispobj object); /* forward decl */
+static sword_t scav_lose(lispobj *where, lispobj object); /* forward decl */
/* FIXME: Most calls end up going to some trouble to compute an
* 'n_words' value for this function. The system might be a little
* simpler if this function used an 'end' parameter instead. */
void
-scavenge(lispobj *start, long n_words)
+scavenge(lispobj *start, sword_t n_words)
{
lispobj *end = start + n_words;
lispobj *object_ptr;
- long n_words_scavenged;
+ sword_t n_words_scavenged;
for (object_ptr = start;
object_ptr < end;
static lispobj trans_fun_header(lispobj object); /* forward decls */
static lispobj trans_boxed(lispobj object);
-static long
+static sword_t
scav_fun_pointer(lispobj *where, lispobj object)
{
lispobj *first_pointer;
#ifdef LISP_FEATURE_GENCGC
/* Cheneygc doesn't need this os_flush_icache, it flushes the whole
spaces once when all copying is done. */
- os_flush_icache((os_vm_address_t) (((long *)new_code) + nheader_words),
- ncode_words * sizeof(long));
+ os_flush_icache((os_vm_address_t) (((sword_t *)new_code) + nheader_words),
+ ncode_words * sizeof(sword_t));
#endif
return new_code;
}
-static long
+static sword_t
scav_code_header(lispobj *where, lispobj object)
{
struct code *code;
- long n_header_words, n_code_words, n_words;
+ sword_t n_header_words, n_code_words, n_words;
lispobj entry_point; /* tagged pointer to entry point */
struct simple_fun *function_ptr; /* untagged pointer to entry point */
gc_assert_verbose(is_lisp_pointer(entry_point),
"Entry point %lx\n is not a lisp pointer.",
- (long)entry_point);
+ (sword_t)entry_point);
function_ptr = (struct simple_fun *) native_pointer(entry_point);
gc_assert(widetag_of(function_ptr->header)==SIMPLE_FUN_HEADER_WIDETAG);
}
-static long
+static sword_t
size_code_header(lispobj *where)
{
struct code *code;
- long nheader_words, ncode_words, nwords;
+ sword_t nheader_words, ncode_words, nwords;
code = (struct code *) where;
}
#if !defined(LISP_FEATURE_X86) && ! defined(LISP_FEATURE_X86_64)
-static long
+static sword_t
scav_return_pc_header(lispobj *where, lispobj object)
{
lose("attempted to scavenge a return PC header where=0x%08x object=0x%08x\n",
* have to figure out that the function is still live. */
#if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
-static long
+static sword_t
scav_closure_header(lispobj *where, lispobj object)
{
struct closure *closure;
#endif
#if !(defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64))
-static long
+static sword_t
scav_fun_header(lispobj *where, lispobj object)
{
lose("attempted to scavenge a function header where=0x%08x object=0x%08x\n",
* instances
*/
-static long
+static sword_t
scav_instance_pointer(lispobj *where, lispobj object)
{
lispobj copy, *first_pointer;
static lispobj trans_list(lispobj object);
-static long
+static sword_t
scav_list_pointer(lispobj *where, lispobj object)
{
lispobj first, *first_pointer;
* scavenging and transporting other pointers
*/
-static long
+static sword_t
scav_other_pointer(lispobj *where, lispobj object)
{
lispobj first, *first_pointer;
* immediate, boxed, and unboxed objects
*/
-static long
+static sword_t
size_pointer(lispobj *where)
{
return 1;
}
-static long
+static sword_t
scav_immediate(lispobj *where, lispobj object)
{
return 1;
return NIL; /* bogus return value to satisfy static type checking */
}
-static long
+static sword_t
size_immediate(lispobj *where)
{
return 1;
}
-static long
+static sword_t
scav_boxed(lispobj *where, lispobj object)
{
return 1;
}
-static long
+static sword_t
scav_instance(lispobj *where, lispobj object)
{
lispobj nuntagged;
- long ntotal = HeaderValue(object);
+ sword_t ntotal = HeaderValue(object);
lispobj layout = ((struct instance *)where)->slots[0];
if (!layout)
}
-static long
+static sword_t
size_boxed(lispobj *where)
{
lispobj header;
/* Note: on the sparc we don't have to do anything special for fdefns, */
/* 'cause the raw-addr has a function lowtag. */
#if !defined(LISP_FEATURE_SPARC)
-static long
+static sword_t
scav_fdefn(lispobj *where, lispobj object)
{
struct fdefn *fdefn;
}
#endif
-static long
+static sword_t
scav_unboxed(lispobj *where, lispobj object)
{
uword_t length;
return copy_unboxed_object(object, length);
}
-static long
+static sword_t
size_unboxed(lispobj *where)
{
lispobj header;
\f
/* vector-like objects */
-static long
+static sword_t
scav_base_string(lispobj *where, lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
/* NOTE: Strings contain one more byte of data than the length */
/* slot indicates. */
trans_base_string(lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static long
+static sword_t
size_base_string(lispobj *where)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
/* NOTE: A string contains one more byte of data (a terminating
* '\0' to help when interfacing with C functions) than indicated
return nwords;
}
-static long
+static sword_t
scav_character_string(lispobj *where, lispobj object)
{
struct vector *vector;
return copy_large_unboxed_object(object, nwords);
}
-static long
+static sword_t
size_character_string(lispobj *where)
{
struct vector *vector;
trans_vector(lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_object(object, nwords);
}
-static long
+static sword_t
size_vector(lispobj *where)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
return nwords;
}
-static long
+static sword_t
scav_vector_nil(lispobj *where, lispobj object)
{
return 2;
return copy_unboxed_object(object, 2);
}
-static long
+static sword_t
size_vector_nil(lispobj *where)
{
/* Just the header word and the length word */
return 2;
}
-static long
+static sword_t
scav_vector_bit(lispobj *where, lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_bit(lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static long
+static sword_t
size_vector_bit(lispobj *where)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
return nwords;
}
-static long
+static sword_t
scav_vector_unsigned_byte_2(lispobj *where, lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_unsigned_byte_2(lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static long
+static sword_t
size_vector_unsigned_byte_2(lispobj *where)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
return nwords;
}
-static long
+static sword_t
scav_vector_unsigned_byte_4(lispobj *where, lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_unsigned_byte_4(lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static long
+static sword_t
size_vector_unsigned_byte_4(lispobj *where)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
}
-static long
+static sword_t
scav_vector_unsigned_byte_8(lispobj *where, lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_unsigned_byte_8(lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static long
+static sword_t
size_vector_unsigned_byte_8(lispobj *where)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
}
-static long
+static sword_t
scav_vector_unsigned_byte_16(lispobj *where, lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_unsigned_byte_16(lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static long
+static sword_t
size_vector_unsigned_byte_16(lispobj *where)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
return nwords;
}
-static long
+static sword_t
scav_vector_unsigned_byte_32(lispobj *where, lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_unsigned_byte_32(lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static long
+static sword_t
size_vector_unsigned_byte_32(lispobj *where)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
}
#if N_WORD_BITS == 64
-static long
+static sword_t
scav_vector_unsigned_byte_64(lispobj *where, lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_unsigned_byte_64(lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static long
+static sword_t
size_vector_unsigned_byte_64(lispobj *where)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
}
#endif
-static long
+static sword_t
scav_vector_single_float(lispobj *where, lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_single_float(lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static long
+static sword_t
size_vector_single_float(lispobj *where)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
return nwords;
}
-static long
+static sword_t
scav_vector_double_float(lispobj *where, lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_double_float(lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static long
+static sword_t
size_vector_double_float(lispobj *where)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
size_vector_long_float(lispobj *where)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
#ifdef SIMPLE_ARRAY_COMPLEX_SINGLE_FLOAT_WIDETAG
-static long
+static sword_t
scav_vector_complex_single_float(lispobj *where, lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_complex_single_float(lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static long
+static sword_t
size_vector_complex_single_float(lispobj *where)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
#endif
#ifdef SIMPLE_ARRAY_COMPLEX_DOUBLE_FLOAT_WIDETAG
-static long
+static sword_t
scav_vector_complex_double_float(lispobj *where, lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_complex_double_float(lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static long
+static sword_t
size_vector_complex_double_float(lispobj *where)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
scav_vector_complex_long_float(lispobj *where, lispobj object)
{
struct vector *vector;
- long length, nwords;
+ sword_t length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
return copy;
}
-static long
+static sword_t
size_weak_pointer(lispobj *where)
{
return WEAK_POINTER_NWORDS;
}
}
-long
+sword_t
scav_vector (lispobj *where, lispobj object)
{
uword_t kv_length;
* initialization
*/
-static long
+static sword_t
scav_lose(lispobj *where, lispobj object)
{
lose("no scavenge function for object 0x%08x (widetag 0x%x)\n",
return NIL; /* bogus return value to satisfy static type checking */
}
-static long
+static sword_t
size_lose(lispobj *where)
{
lose("no size function for object at 0x%08x (widetag 0x%x)\n",
*register_pair = -1;
for (i = 0; i < (sizeof(boxed_registers) / sizeof(int)); i++) {
uword_t reg;
- long offset;
+ sword_t offset;
int index;
index = boxed_registers[i];
#ifdef LISP_FEATURE_GENCGC
#include "gencgc-alloc-region.h"
void *
-gc_alloc_with_region(long nbytes,int page_type_flag, struct alloc_region *my_region,
+gc_alloc_with_region(sword_t nbytes,int page_type_flag, struct alloc_region *my_region,
int quick_p);
static inline void *
-gc_general_alloc(long nbytes, int page_type_flag, int quick_p)
+gc_general_alloc(sword_t nbytes, int page_type_flag, int quick_p)
{
struct alloc_region *my_region;
if (UNBOXED_PAGE_FLAG == page_type_flag) {
return gc_alloc_with_region(nbytes, page_type_flag, my_region, quick_p);
}
#else
-extern void *gc_general_alloc(long nbytes,int page_type_flag,int quick_p);
+extern void *gc_general_alloc(word_t nbytes,int page_type_flag,int quick_p);
#endif
static inline lispobj
return make_lispobj(new, lowtag_of(object));
}
-extern long (*scavtab[256])(lispobj *where, lispobj object);
+extern sword_t (*scavtab[256])(lispobj *where, lispobj object);
extern lispobj (*transother[256])(lispobj object);
-extern long (*sizetab[256])(lispobj *where);
+extern sword_t (*sizetab[256])(lispobj *where);
extern struct weak_pointer *weak_pointers; /* in gc-common.c */
extern struct hash_table *weak_hash_tables; /* in gc-common.c */
-extern void scavenge(lispobj *start, long n_words);
+extern void scavenge(lispobj *start, sword_t n_words);
extern void scavenge_interrupt_contexts(struct thread *thread);
extern void scav_weak_hash_tables(void);
extern void scan_weak_hash_tables(void);
extern void scan_weak_pointers(void);
-lispobj copy_large_unboxed_object(lispobj object, long nwords);
-lispobj copy_unboxed_object(lispobj object, long nwords);
-lispobj copy_large_object(lispobj object, long nwords);
-lispobj copy_object(lispobj object, long nwords);
-lispobj copy_code_object(lispobj object, long nwords);
+lispobj copy_large_unboxed_object(lispobj object, sword_t nwords);
+lispobj copy_unboxed_object(lispobj object, sword_t nwords);
+lispobj copy_large_object(lispobj object, sword_t nwords);
+lispobj copy_object(lispobj object, sword_t nwords);
+lispobj copy_code_object(lispobj object, sword_t nwords);
lispobj *search_read_only_space(void *pointer);
lispobj *search_static_space(void *pointer);
void sniff_code_object(struct code *code, os_vm_size_t displacement);
void gencgc_apply_code_fixups(struct code *old_code, struct code *new_code);
-long update_dynamic_space_free_pointer(void);
+sword_t update_dynamic_space_free_pointer(void);
void gc_alloc_update_page_tables(int page_type_flag, struct alloc_region *alloc_region);
void gc_alloc_update_all_page_tables(void);
void gc_set_region_empty(struct alloc_region *region);
#endif
/* forward declarations */
-page_index_t gc_find_freeish_pages(page_index_t *restart_page_ptr, long nbytes,
+page_index_t gc_find_freeish_pages(page_index_t *restart_page_ptr, sword_t nbytes,
int page_type_flag);
\f
* are allocated, although they will initially be empty.
*/
static void
-gc_alloc_new_region(long nbytes, int page_type_flag, struct alloc_region *alloc_region)
+gc_alloc_new_region(sword_t nbytes, int page_type_flag, struct alloc_region *alloc_region)
{
page_index_t first_page;
page_index_t last_page;
gc_set_region_empty(alloc_region);
}
-static inline void *gc_quick_alloc(long nbytes);
+static inline void *gc_quick_alloc(word_t nbytes);
/* Allocate a possibly large object. */
void *
-gc_alloc_large(long nbytes, int page_type_flag, struct alloc_region *alloc_region)
+gc_alloc_large(sword_t nbytes, int page_type_flag, struct alloc_region *alloc_region)
{
boolean more;
page_index_t first_page, next_page, last_page;
static page_index_t gencgc_alloc_start_page = -1;
void
-gc_heap_exhausted_error_or_lose (long available, long requested)
+gc_heap_exhausted_error_or_lose (sword_t available, sword_t requested)
{
struct thread *thread = arch_os_get_current_thread();
/* Write basic information before doing anything else: if we don't
}
page_index_t
-gc_find_freeish_pages(page_index_t *restart_page_ptr, long bytes,
+gc_find_freeish_pages(page_index_t *restart_page_ptr, sword_t bytes,
int page_type_flag)
{
page_index_t most_bytes_found_from = 0, most_bytes_found_to = 0;
* functions will eventually call this */
void *
-gc_alloc_with_region(long nbytes,int page_type_flag, struct alloc_region *my_region,
+gc_alloc_with_region(sword_t nbytes,int page_type_flag, struct alloc_region *my_region,
int quick_p)
{
void *new_free_pointer;
* region */
static inline void *
-gc_quick_alloc(long nbytes)
+gc_quick_alloc(word_t nbytes)
{
return gc_general_alloc(nbytes, BOXED_PAGE_FLAG, ALLOC_QUICK);
}
static inline void *
-gc_alloc_unboxed(long nbytes)
+gc_alloc_unboxed(word_t nbytes)
{
return gc_general_alloc(nbytes, UNBOXED_PAGE_FLAG, 0);
}
static inline void *
-gc_quick_alloc_unboxed(long nbytes)
+gc_quick_alloc_unboxed(word_t nbytes)
{
return gc_general_alloc(nbytes, UNBOXED_PAGE_FLAG, ALLOC_QUICK);
}
* Bignums and vectors may have shrunk. If the object is not copied
* the space needs to be reclaimed, and the page_tables corrected. */
static lispobj
-general_copy_large_object(lispobj object, long nwords, boolean boxedp)
+general_copy_large_object(lispobj object, word_t nwords, boolean boxedp)
{
int tag;
lispobj *new;
}
lispobj
-copy_large_object(lispobj object, long nwords)
+copy_large_object(lispobj object, sword_t nwords)
{
return general_copy_large_object(object, nwords, 1);
}
lispobj
-copy_large_unboxed_object(lispobj object, long nwords)
+copy_large_unboxed_object(lispobj object, sword_t nwords)
{
return general_copy_large_object(object, nwords, 0);
}
/* to copy unboxed objects */
lispobj
-copy_unboxed_object(lispobj object, long nwords)
+copy_unboxed_object(lispobj object, sword_t nwords)
{
return gc_general_copy_object(object, nwords, UNBOXED_PAGE_FLAG);
}
sniff_code_object(struct code *code, os_vm_size_t displacement)
{
#ifdef LISP_FEATURE_X86
- long nheader_words, ncode_words, nwords;
+ sword_t nheader_words, ncode_words, nwords;
os_vm_address_t constants_start_addr = NULL, constants_end_addr, p;
os_vm_address_t code_start_addr, code_end_addr;
os_vm_address_t code_addr = (os_vm_address_t)code;
{
/* x86-64 uses pc-relative addressing instead of this kludge */
#ifndef LISP_FEATURE_X86_64
- long nheader_words, ncode_words, nwords;
+ sword_t nheader_words, ncode_words, nwords;
os_vm_address_t constants_start_addr, constants_end_addr;
os_vm_address_t code_start_addr, code_end_addr;
os_vm_address_t code_addr = (os_vm_address_t)new_code;
if (widetag_of(fixups_vector->header) == SIMPLE_ARRAY_WORD_WIDETAG) {
/* Got the fixups for the code block. Now work through the vector,
and apply a fixup at each address. */
- long length = fixnum_value(fixups_vector->length);
- long i;
+ sword_t length = fixnum_value(fixups_vector->length);
+ sword_t i;
for (i = 0; i < length; i++) {
long offset = fixups_vector->data[i];
/* Now check the current value of offset. */
#define WEAK_POINTER_NWORDS \
CEILING((sizeof(struct weak_pointer) / sizeof(lispobj)), 2)
-static long
+static sword_t
scav_weak_pointer(lispobj *where, lispobj object)
{
/* Since we overwrite the 'next' field, we have to make
{
page_index_t first_page;
page_index_t next_page;
- long nwords;
+ sword_t nwords;
uword_t remaining_bytes;
uword_t bytes_freed;
update_page_write_prot(page_index_t page)
{
generation_index_t gen = page_table[page].gen;
- long j;
+ sword_t j;
int wp_it = 1;
void **page_addr = (void **)page_address(page);
- long num_words = page_table[page].bytes_used / N_WORD_BYTES;
+ sword_t num_words = page_table[page].bytes_used / N_WORD_BYTES;
/* Shouldn't be a free page. */
gc_assert(page_allocated_p(page));
/* Do a limited check for write-protected pages. */
if (!all_wp) {
- long nwords = (((uword_t)
+ sword_t nwords = (((uword_t)
(page_table[last_page].bytes_used
+ npage_bytes(last_page-i)
+ page_table[i].region_start_offset))
if (is_lisp_pointer(thing)) {
page_index_t page_index = find_page_index((void*)thing);
- long to_readonly_space =
+ sword_t to_readonly_space =
(READ_ONLY_SPACE_START <= thing &&
thing < SymbolValue(READ_ONLY_SPACE_FREE_POINTER,0));
- long to_static_space =
+ sword_t to_static_space =
(STATIC_SPACE_START <= thing &&
thing < SymbolValue(STATIC_SPACE_FREE_POINTER,0));
case INSTANCE_HEADER_WIDETAG:
{
lispobj nuntagged;
- long ntotal = HeaderValue(thing);
+ sword_t ntotal = HeaderValue(thing);
lispobj layout = ((struct instance *)start)->slots[0];
if (!layout) {
count = 1;
{
lispobj object = *start;
struct code *code;
- long nheader_words, ncode_words, nwords;
+ sword_t nheader_words, ncode_words, nwords;
lispobj fheaderl;
struct simple_fun *fheaderp;
* Some counts of lispobjs are called foo_count; it might be good
* to grep for all foo_size and rename the appropriate ones to
* foo_count. */
- long read_only_space_size =
+ sword_t read_only_space_size =
(lispobj*)SymbolValue(READ_ONLY_SPACE_FREE_POINTER,0)
- (lispobj*)READ_ONLY_SPACE_START;
- long static_space_size =
+ sword_t static_space_size =
(lispobj*)SymbolValue(STATIC_SPACE_FREE_POINTER,0)
- (lispobj*)STATIC_SPACE_START;
struct thread *th;
for_each_thread(th) {
- long binding_stack_size =
+ sword_t binding_stack_size =
(lispobj*)get_binding_stack_pointer(th)
- (lispobj*)th->binding_stack_start;
verify_space(th->binding_stack_start, binding_stack_size);
for (page = 0; page < last_free_page; page++) {
if (page_free_p(page)) {
/* The whole page should be zero filled. */
- long *start_addr = (long *)page_address(page);
- long size = 1024;
- long i;
+ sword_t *start_addr = (sword_t *)page_address(page);
+ sword_t size = 1024;
+ sword_t i;
for (i = 0; i < size; i++) {
if (start_addr[i] != 0) {
lose("free page not zero at %x\n", start_addr + i);
}
}
} else {
- long free_bytes = GENCGC_CARD_BYTES - page_table[page].bytes_used;
+ sword_t free_bytes = GENCGC_CARD_BYTES - page_table[page].bytes_used;
if (free_bytes > 0) {
- long *start_addr = (long *)((uword_t)page_address(page)
+ sword_t *start_addr = (sword_t *)((uword_t)page_address(page)
+ page_table[page].bytes_used);
- long size = free_bytes / N_WORD_BYTES;
- long i;
+ sword_t size = free_bytes / N_WORD_BYTES;
+ sword_t i;
for (i = 0; i < size; i++) {
if (start_addr[i] != 0) {
lose("free region not zero at %x\n", start_addr + i);
}
# endif
# elif defined(LISP_FEATURE_SB_THREAD)
- long i,free;
+ sword_t i,free;
if(th==arch_os_get_current_thread()) {
/* Somebody is going to burn in hell for this, but casting
* it in two steps shuts gcc up about strict aliasing. */
#if QSHOW
if (gencgc_verbose > 1) {
- long num_dont_move_pages = count_dont_move_pages();
+ sword_t num_dont_move_pages = count_dont_move_pages();
fprintf(stderr,
"/non-movable pages due to conservative pointers = %d (%d bytes)\n",
num_dont_move_pages,
{
struct thread *th;
for_each_thread(th) {
- long len= (lispobj *)get_binding_stack_pointer(th) -
+ sword_t len= (lispobj *)get_binding_stack_pointer(th) -
th->binding_stack_start;
scavenge((lispobj *) th->binding_stack_start,len);
#ifdef LISP_FEATURE_SB_THREAD
}
/* Update last_free_page, then SymbolValue(ALLOCATION_POINTER). */
-long
+sword_t
update_dynamic_space_free_pointer(void)
{
page_index_t last_page = -1, i;
#endif
} else if (gencgc_zero_check_during_free_heap) {
/* Double-check that the page is zero filled. */
- long *page_start;
+ sword_t *page_start;
page_index_t i;
gc_assert(page_free_p(page));
gc_assert(page_table[page].bytes_used == 0);
- page_start = (long *)page_address(page);
- for (i=0; i<GENCGC_CARD_BYTES/sizeof(long); i++) {
+ page_start = (sword_t *)page_address(page);
+ for (i=0; i<GENCGC_CARD_BYTES/sizeof(sword_t); i++) {
if (page_start[i] != 0) {
lose("free region not zero at %x\n", page_start + i);
}
* region is full, so in most cases it's not needed. */
static inline lispobj *
-general_alloc_internal(long nbytes, int page_type_flag, struct alloc_region *region,
+general_alloc_internal(sword_t nbytes, int page_type_flag, struct alloc_region *region,
struct thread *thread)
{
#ifndef LISP_FEATURE_WIN32
/* for sb-prof, and not supported on Windows yet */
alloc_signal = SymbolValue(ALLOC_SIGNAL,thread);
if ((alloc_signal & FIXNUM_TAG_MASK) == 0) {
- if ((signed long) alloc_signal <= 0) {
+ if ((sword_t) alloc_signal <= 0) {
SetSymbolValue(ALLOC_SIGNAL, T, thread);
raise(SIGPROF);
} else {
}
lispobj *
-general_alloc(long nbytes, int page_type_flag)
+general_alloc(sword_t nbytes, int page_type_flag)
{
struct thread *thread = arch_os_get_current_thread();
/* Select correct region, and call general_alloc_internal with it.
/* fprintf(stderr,"dynamic_space_free_pointer: %p\n", */
/* dynamic_space_free_pointer); */
#if defined(LISP_FEATURE_ALPHA) || defined(LISP_FEATURE_MIPS)
- if ((long)dynamic_space_free_pointer & 1) {
+ if ((sword_t)dynamic_space_free_pointer & 1) {
lose("dead in fake_foreign_function_call, context = %x\n", context);
}
#endif
/* why doesnt PPC and SPARC do something like this: */
#if defined(LISP_FEATURE_HPPA)
- if ((long)dynamic_space_free_pointer & 4) {
+ if ((sword_t)dynamic_space_free_pointer & 4) {
lose("dead in fake_foreign_function_call, context = %x, d_s_f_p = %x\n", context, dynamic_space_free_pointer);
}
#endif
/* Align down to multiple of page_table page size, and to the appropriate
* stack alignment. */
- dynamic_space_size &= ~(PAGE_BYTES-1);
+ dynamic_space_size &= ~(sword_t)(PAGE_BYTES-1);
#ifdef LISP_FEATURE_GENCGC
- dynamic_space_size &= ~(GENCGC_CARD_BYTES-1);
+ dynamic_space_size &= ~(sword_t)(GENCGC_CARD_BYTES-1);
#endif
- thread_control_stack_size &= ~(CONTROL_STACK_ALIGNMENT_BYTES-1);
+ thread_control_stack_size &= ~(sword_t)(CONTROL_STACK_ALIGNMENT_BYTES-1);
/* Preserve the runtime options for possible future core saving */
runtime_options->dynamic_space_size = dynamic_space_size;
#define MAKE_FIXNUM(n) (n << N_FIXNUM_TAG_BITS)
static inline lispobj
-make_fixnum(long n)
+make_fixnum(sword_t n)
{
return MAKE_FIXNUM(n);
}
-static inline long
+static inline sword_t
fixnum_value(lispobj n)
{
return n >> N_FIXNUM_TAG_BITS;
{
if (compression == COMPRESSION_LEVEL_NONE) {
while (bytes > 0) {
- long count = fwrite(addr, 1, bytes, file);
+ sword_t count = fwrite(addr, 1, bytes, file);
if (count > 0) {
bytes -= count;
addr += count;
#ifdef LISP_FEATURE_GENCGC
{
- size_t size = (last_free_page*sizeof(long)+os_vm_page_size-1)
+ size_t size = (last_free_page*sizeof(sword_t)+os_vm_page_size-1)
&~(os_vm_page_size-1);
uword_t *data = calloc(size, 1);
if (data) {
uword_t word;
- long offset;
+ sword_t offset;
page_index_t i;
for (i = 0; i < last_free_page; i++) {
/* Thanks to alignment requirements, the two low bits
lispobj obj;
lispobj (*update_fn)(struct var *var);
char *name;
- long clock;
+ sword_t clock;
boolean map_back, permanent;
struct var *nnext; /* Next in name list */
return var->obj;
}
-long var_clock(struct var *var)
+sword_t var_clock(struct var *var)
{
return var->clock;
}
-void var_setclock(struct var *var, long val)
+void var_setclock(struct var *var, sword_t val)
{
var->clock = val;
}
extern char *var_name(struct var *var);
extern lispobj var_value(struct var *var);
-extern long var_clock(struct var *var);
-extern void var_setclock(struct var *var, long value);
+extern sword_t var_clock(struct var *var);
+extern void var_setclock(struct var *var, sword_t value);