struct object {
NO_TYPE_CHECK;
+ // header format (bits indexed with least significant as zero):
+ // bit 0 : free?
+ // if not forwarding:
+ // bit 1 : forwarding pointer?
+ // bit 2-5 : tag
+ // bit 7-end : hashcode
+ // if forwarding:
+ // bit 2-end : forwarding pointer
cell header;
template <typename Fixup> cell base_size(Fixup fixup) const;
cell* data() const { return (cell*)(this + 1); }
};
+inline static cell tuple_size(const tuple_layout* layout) {
+ cell size = untag_fixnum(layout->size);
+ return sizeof(tuple) + size * sizeof(cell);
+}
+
+inline static cell string_capacity(const string* str) {
+ return untag_fixnum(str->length);
+}
+
+inline static cell string_size(cell size) { return sizeof(string) + size; }
+
}
#include "mark_bits.hpp"
#include "free_list.hpp"
#include "fixup.hpp"
-#include "tuples.hpp"
#include "free_list_allocator.hpp"
#include "write_barrier.hpp"
#include "object_start_map.hpp"
#include "data_heap.hpp"
#include "code_heap.hpp"
#include "gc.hpp"
-#include "strings.hpp"
#include "float_bits.hpp"
#include "io.hpp"
#include "image.hpp"
+++ /dev/null
-namespace factor {
-
-inline static cell string_capacity(const string* str) {
- return untag_fixnum(str->length);
-}
-
-inline static cell string_size(cell size) { return sizeof(string) + size; }
-
-}
+++ /dev/null
-namespace factor {
-
-inline static cell tuple_size(const tuple_layout* layout) {
- cell size = untag_fixnum(layout->size);
- return sizeof(tuple) + size * sizeof(cell);
-}
-
-}