Skip to content

Commit

Permalink
Merge pull request #1656 from clasp-developers/gc-cleanup
Browse files Browse the repository at this point in the history
Gc cleanup
  • Loading branch information
Bike authored Jan 3, 2025
2 parents 08cf7cf + 2abd0aa commit 976dbc4
Show file tree
Hide file tree
Showing 106 changed files with 963 additions and 5,056 deletions.
5 changes: 0 additions & 5 deletions include/clasp/clbind/class_registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ FORWARD(ClassRegistry);
class ClassRegistry_O : public core::General_O {
LISP_CLASS(clbind, ClbindPkg, ClassRegistry_O, "ClassRegistry", core::General_O);
void initialize() override;

public:
ClassRegistry_O(){};
virtual ~ClassRegistry_O(){};

public:
static ClassRegistry_sp get_registry();

Expand Down
1 change: 0 additions & 1 deletion include/clasp/clbind/constructor.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class ConstructorCreator_O : public core::Creator_O {
public:
ConstructorCreator_O(core::SimpleFun_sp ep, core::Symbol_sp c) : Creator_O(ep), _mostDerivedClassSymbol(c){};
core::Symbol_sp _mostDerivedClassSymbol;
virtual ~ConstructorCreator_O(){};
};
}; // namespace clbind

Expand Down
36 changes: 1 addition & 35 deletions include/clasp/core/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ size_t calculateArrayTotalSizeAndValidateDimensions(List_sp dim_desig, size_t& r
namespace core {
class Array_O : public General_O {
LISP_ABSTRACT_CLASS(core, ClPkg, Array_O, "array", General_O);
virtual ~Array_O(){};

public:
/*! A hackish (clever?) way to get at the first element of all subclasses
Expand All @@ -165,9 +164,6 @@ class Array_O : public General_O {
*/
size_t _Length[0];

public:
Array_O(){};

public:
// Low level functions for access to contents

Expand Down Expand Up @@ -259,19 +255,15 @@ namespace core {
struct Rank1 {};
class MDArray_O : public Array_O {
LISP_ABSTRACT_CLASS(core, CorePkg, MDArray_O, "mdarray", Array_O);
virtual ~MDArray_O(){};

public:
MDArray_O(){};

public:
typedef size_t value_type; // this is container - needs value_type
typedef gctools::GCArray_moveable<value_type> vector_type;
struct Flags {
Flags(){};
size_t _Flags;
static const size_t fillPointerFlag = 0x000001;
static const size_t displacedToFlag = 0x000100;
Flags() = default;
Flags(bool fillPointerP, bool displacedToP)
: _Flags((fillPointerP ? fillPointerFlag : 0) | (displacedToP ? displacedToFlag : 0)){};
bool fillPointerP() const { return this->_Flags & fillPointerFlag; };
Expand Down Expand Up @@ -367,7 +359,6 @@ class ComplexVector_O : public MDArray_O {
LISP_ABSTRACT_CLASS(core, CorePkg, ComplexVector_O, "ComplexVector", MDArray_O);
// One dimension vector
public:
CLASP_DEFAULT_CTOR ComplexVector_O(){};
ComplexVector_O(size_t dimension, T_sp fillPointer, Array_sp data, bool displacedToP, Fixnum_sp displacedIndexOffset)
: MDArray_O(Rank1(), dimension, fillPointer, data, displacedToP, displacedIndexOffset){};

Expand All @@ -380,10 +371,6 @@ namespace core {
class SimpleMDArray_O : public MDArray_O {
LISP_ABSTRACT_CLASS(core, CorePkg, SimpleMDArray_O, "simple-mdarray", MDArray_O);

public:
CLASP_DEFAULT_CTOR SimpleMDArray_O(){};
virtual ~SimpleMDArray_O(){};

public:
// multiple dimensions
SimpleMDArray_O(size_t rank, List_sp dimensions, Array_sp data)
Expand All @@ -405,10 +392,6 @@ namespace core {

class AbstractSimpleVector_O : public Array_O {
LISP_ABSTRACT_CLASS(core, CorePkg, AbstractSimpleVector_O, "AbstractSimpleVector", Array_O);
virtual ~AbstractSimpleVector_O(){};

public:
AbstractSimpleVector_O(){};

public:
virtual T_sp array_type() const override { return cl::_sym_simple_array; };
Expand Down Expand Up @@ -455,9 +438,6 @@ class AbstractSimpleVector_O : public Array_O {

namespace core {
template <typename MyLeafType, typename ValueType, typename MyParentType> class template_SimpleVector : public MyParentType {
public:
template_SimpleVector(){};

public:
// The types that define what this class does
typedef MyParentType Base;
Expand Down Expand Up @@ -488,9 +468,6 @@ template <typename MyLeafType, typename ValueType, typename MyParentType> class
template_SimpleVector(I first, S last)
: Base(), _Data(first, last) {};

public:
static void never_invoke_allocator() { gctools::GCAbstractAllocator<template_SimpleVector>::never_invoke_allocator(); };

public:
leaf_smart_ptr_type copy(size_t length, value_type initialElement, bool initialElementSupplied) {
return leaf_type::make(length, initialElement, initialElementSupplied, MIN(length, this->length()), this->begin());
Expand Down Expand Up @@ -549,8 +526,6 @@ template <typename MyLeafType, typename ValueType, typename MyParentType> class
namespace core {
template <typename MyLeafType, int BitUnitBitWidth, int Signedp>
class template_SimpleBitUnitVector : public AbstractSimpleVector_O {
public:
CLASP_DEFAULT_CTOR template_SimpleBitUnitVector(){};

public:
typedef AbstractSimpleVector_O Base;
Expand Down Expand Up @@ -668,9 +643,6 @@ MDArray_sp core__make_mdarray(List_sp dimensions, T_sp element_type, bool adjust
namespace core {
template <typename MyArrayType, typename MySimpleArrayType, typename MySimpleType, typename MyParentType>
class template_Array : public MyParentType {
public:
CLASP_DEFAULT_CTOR template_Array(){};

public:
// The types that define what this class does
typedef MyParentType Base; /* e.g. MDArray_O */
Expand Down Expand Up @@ -787,9 +759,6 @@ class template_Array : public MyParentType {

namespace core {
template <typename MyArrayType, typename MySimpleType, typename MyParentType> class template_Vector : public MyParentType {
public:
CLASP_DEFAULT_CTOR template_Vector(){};

public:
// The types that define what this class does
typedef MyParentType Base;
Expand Down Expand Up @@ -920,9 +889,6 @@ template <typename MyArrayType, typename MySimpleType, typename MyParentType> cl

namespace core {
template <typename MyArrayType, typename MySimpleType, typename MyParentType> class template_SimpleArray : public MyParentType {
public:
CLASP_DEFAULT_CTOR template_SimpleArray(){};

public:
// The types that define what this class does
typedef MyParentType Base;
Expand Down
4 changes: 0 additions & 4 deletions include/clasp/core/array_bit.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace core {
typedef template_SimpleBitUnitVector<SimpleBitVector_O, 1, false> specialized_SimpleBitVector;
class SimpleBitVector_O : public specialized_SimpleBitVector {
LISP_CLASS(core, ClPkg, SimpleBitVector_O, "simple-bit-vector", AbstractSimpleVector_O);
virtual ~SimpleBitVector_O(){};

public:
typedef specialized_SimpleBitVector TemplatedBase;
Expand Down Expand Up @@ -76,7 +75,6 @@ class SimpleBitVector_O : public specialized_SimpleBitVector {
namespace core {
class BitVectorNs_O : public template_Vector<BitVectorNs_O, SimpleBitVector_O, ComplexVector_O> {
LISP_CLASS(core, CorePkg, BitVectorNs_O, "BitVectorNs", ComplexVector_O);
virtual ~BitVectorNs_O(){};

public:
typedef template_Vector<BitVectorNs_O, SimpleBitVector_O, ComplexVector_O> TemplatedBase;
Expand Down Expand Up @@ -116,7 +114,6 @@ class BitVectorNs_O : public template_Vector<BitVectorNs_O, SimpleBitVector_O, C
namespace core {
class MDArrayBit_O : public template_Array<MDArrayBit_O, SimpleMDArrayBit_O, SimpleBitVector_O, MDArray_O> {
LISP_CLASS(core, CorePkg, MDArrayBit_O, "MDArrayBit", MDArray_O);
virtual ~MDArrayBit_O(){};

public:
typedef template_Array<MDArrayBit_O, SimpleMDArrayBit_O, SimpleBitVector_O, MDArray_O> TemplatedBase;
Expand All @@ -130,7 +127,6 @@ class MDArrayBit_O : public template_Array<MDArrayBit_O, SimpleMDArrayBit_O, Sim
namespace core {
class SimpleMDArrayBit_O : public template_SimpleArray<SimpleMDArrayBit_O, SimpleBitVector_O, SimpleMDArray_O> {
LISP_CLASS(core, CorePkg, SimpleMDArrayBit_O, "SimpleMDArrayBit", SimpleMDArray_O);
virtual ~SimpleMDArrayBit_O(){};

public:
typedef template_SimpleArray<SimpleMDArrayBit_O, SimpleBitVector_O, SimpleMDArray_O> TemplatedBase;
Expand Down
4 changes: 0 additions & 4 deletions include/clasp/core/array_double.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class SimpleVector_double_O;
typedef template_SimpleVector<SimpleVector_double_O, double, AbstractSimpleVector_O> specialized_SimpleVector_double;
class SimpleVector_double_O : public specialized_SimpleVector_double {
LISP_CLASS(core, CorePkg, SimpleVector_double_O, "SimpleVector_double", AbstractSimpleVector_O);
virtual ~SimpleVector_double_O(){};

public:
typedef specialized_SimpleVector_double TemplatedBase;
Expand Down Expand Up @@ -59,7 +58,6 @@ class SimpleVector_double_O : public specialized_SimpleVector_double {
namespace core {
class MDArray_double_O : public template_Array<MDArray_double_O, SimpleMDArray_double_O, SimpleVector_double_O, MDArray_O> {
LISP_CLASS(core, CorePkg, MDArray_double_O, "MDArray_double", MDArray_O);
virtual ~MDArray_double_O(){};

public:
typedef template_Array<MDArray_double_O, SimpleMDArray_double_O, SimpleVector_double_O, MDArray_O> TemplatedBase;
Expand All @@ -73,7 +71,6 @@ class MDArray_double_O : public template_Array<MDArray_double_O, SimpleMDArray_d
namespace core {
class SimpleMDArray_double_O : public template_SimpleArray<SimpleMDArray_double_O, SimpleVector_double_O, SimpleMDArray_O> {
LISP_CLASS(core, CorePkg, SimpleMDArray_double_O, "SimpleMDArray_double", SimpleMDArray_O);
virtual ~SimpleMDArray_double_O(){};

public:
typedef template_SimpleArray<SimpleMDArray_double_O, SimpleVector_double_O, SimpleMDArray_O> TemplatedBase;
Expand All @@ -86,7 +83,6 @@ class SimpleMDArray_double_O : public template_SimpleArray<SimpleMDArray_double_
namespace core {
class ComplexVector_double_O : public template_Vector<ComplexVector_double_O, SimpleVector_double_O, ComplexVector_O> {
LISP_CLASS(core, CorePkg, ComplexVector_double_O, "ComplexVector_double", ComplexVector_O);
virtual ~ComplexVector_double_O(){};

public:
typedef template_Vector<ComplexVector_double_O, SimpleVector_double_O, ComplexVector_O> TemplatedBase;
Expand Down
4 changes: 0 additions & 4 deletions include/clasp/core/array_fixnum.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class SimpleVector_fixnum_O;
typedef template_SimpleVector<SimpleVector_fixnum_O, Fixnum, AbstractSimpleVector_O> specialized_SimpleVector_fixnum;
class SimpleVector_fixnum_O : public specialized_SimpleVector_fixnum {
LISP_CLASS(core, CorePkg, SimpleVector_fixnum_O, "SimpleVector_fixnum", AbstractSimpleVector_O);
virtual ~SimpleVector_fixnum_O(){};

public:
typedef specialized_SimpleVector_fixnum TemplatedBase;
Expand Down Expand Up @@ -50,7 +49,6 @@ class SimpleVector_fixnum_O : public specialized_SimpleVector_fixnum {
namespace core {
class MDArray_fixnum_O : public template_Array<MDArray_fixnum_O, SimpleMDArray_fixnum_O, SimpleVector_fixnum_O, MDArray_O> {
LISP_CLASS(core, CorePkg, MDArray_fixnum_O, "MDArray_fixnum", MDArray_O);
virtual ~MDArray_fixnum_O(){};

public:
typedef template_Array<MDArray_fixnum_O, SimpleMDArray_fixnum_O, SimpleVector_fixnum_O, MDArray_O> TemplatedBase;
Expand All @@ -64,7 +62,6 @@ class MDArray_fixnum_O : public template_Array<MDArray_fixnum_O, SimpleMDArray_f
namespace core {
class SimpleMDArray_fixnum_O : public template_SimpleArray<SimpleMDArray_fixnum_O, SimpleVector_fixnum_O, SimpleMDArray_O> {
LISP_CLASS(core, CorePkg, SimpleMDArray_fixnum_O, "SimpleMDArray_fixnum", SimpleMDArray_O);
virtual ~SimpleMDArray_fixnum_O(){};

public:
typedef template_SimpleArray<SimpleMDArray_fixnum_O, SimpleVector_fixnum_O, SimpleMDArray_O> TemplatedBase;
Expand All @@ -77,7 +74,6 @@ class SimpleMDArray_fixnum_O : public template_SimpleArray<SimpleMDArray_fixnum_
namespace core {
class ComplexVector_fixnum_O : public template_Vector<ComplexVector_fixnum_O, SimpleVector_fixnum_O, ComplexVector_O> {
LISP_CLASS(core, CorePkg, ComplexVector_fixnum_O, "ComplexVector_fixnum", ComplexVector_O);
virtual ~ComplexVector_fixnum_O(){};

public:
typedef template_Vector<ComplexVector_fixnum_O, SimpleVector_fixnum_O, ComplexVector_O> TemplatedBase;
Expand Down
4 changes: 0 additions & 4 deletions include/clasp/core/array_float.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class SimpleVector_float_O;
typedef template_SimpleVector<SimpleVector_float_O, float, AbstractSimpleVector_O> specialized_SimpleVector_float;
class SimpleVector_float_O : public specialized_SimpleVector_float {
LISP_CLASS(core, CorePkg, SimpleVector_float_O, "SimpleVector_float", AbstractSimpleVector_O);
virtual ~SimpleVector_float_O(){};

public:
typedef specialized_SimpleVector_float TemplatedBase;
Expand Down Expand Up @@ -65,7 +64,6 @@ class SimpleVector_float_O : public specialized_SimpleVector_float {
namespace core {
class MDArray_float_O : public template_Array<MDArray_float_O, SimpleMDArray_float_O, SimpleVector_float_O, MDArray_O> {
LISP_CLASS(core, CorePkg, MDArray_float_O, "MDArray_float", MDArray_O);
virtual ~MDArray_float_O(){};

public:
typedef template_Array<MDArray_float_O, SimpleMDArray_float_O, SimpleVector_float_O, MDArray_O> TemplatedBase;
Expand All @@ -79,7 +77,6 @@ class MDArray_float_O : public template_Array<MDArray_float_O, SimpleMDArray_flo
namespace core {
class SimpleMDArray_float_O : public template_SimpleArray<SimpleMDArray_float_O, SimpleVector_float_O, SimpleMDArray_O> {
LISP_CLASS(core, CorePkg, SimpleMDArray_float_O, "SimpleMDArray_float", SimpleMDArray_O);
virtual ~SimpleMDArray_float_O(){};

public:
typedef template_SimpleArray<SimpleMDArray_float_O, SimpleVector_float_O, SimpleMDArray_O> TemplatedBase;
Expand All @@ -92,7 +89,6 @@ class SimpleMDArray_float_O : public template_SimpleArray<SimpleMDArray_float_O,
namespace core {
class ComplexVector_float_O : public template_Vector<ComplexVector_float_O, SimpleVector_float_O, ComplexVector_O> {
LISP_CLASS(core, CorePkg, ComplexVector_float_O, "ComplexVector_float", ComplexVector_O);
virtual ~ComplexVector_float_O(){};

public:
typedef template_Vector<ComplexVector_float_O, SimpleVector_float_O, ComplexVector_O> TemplatedBase;
Expand Down
8 changes: 0 additions & 8 deletions include/clasp/core/array_int16.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class SimpleVector_byte16_t_O;
typedef template_SimpleVector<SimpleVector_byte16_t_O, byte16_t, AbstractSimpleVector_O> specialized_SimpleVector_byte16_t;
class SimpleVector_byte16_t_O : public specialized_SimpleVector_byte16_t {
LISP_CLASS(core, CorePkg, SimpleVector_byte16_t_O, "SimpleVector_byte16_t", AbstractSimpleVector_O);
virtual ~SimpleVector_byte16_t_O(){};

public:
typedef specialized_SimpleVector_byte16_t TemplatedBase;
Expand Down Expand Up @@ -50,7 +49,6 @@ class SimpleVector_byte16_t_O : public specialized_SimpleVector_byte16_t {
namespace core {
class MDArray_byte16_t_O : public template_Array<MDArray_byte16_t_O, SimpleMDArray_byte16_t_O, SimpleVector_byte16_t_O, MDArray_O> {
LISP_CLASS(core, CorePkg, MDArray_byte16_t_O, "MDArray_byte16_t", MDArray_O);
virtual ~MDArray_byte16_t_O(){};

public:
typedef template_Array<MDArray_byte16_t_O, SimpleMDArray_byte16_t_O, SimpleVector_byte16_t_O, MDArray_O> TemplatedBase;
Expand All @@ -64,7 +62,6 @@ class MDArray_byte16_t_O : public template_Array<MDArray_byte16_t_O, SimpleMDArr
namespace core {
class SimpleMDArray_byte16_t_O : public template_SimpleArray<SimpleMDArray_byte16_t_O, SimpleVector_byte16_t_O, SimpleMDArray_O> {
LISP_CLASS(core, CorePkg, SimpleMDArray_byte16_t_O, "SimpleMDArray_byte16_t", SimpleMDArray_O);
virtual ~SimpleMDArray_byte16_t_O(){};

public:
typedef template_SimpleArray<SimpleMDArray_byte16_t_O, SimpleVector_byte16_t_O, SimpleMDArray_O> TemplatedBase;
Expand All @@ -77,7 +74,6 @@ class SimpleMDArray_byte16_t_O : public template_SimpleArray<SimpleMDArray_byte1
namespace core {
class ComplexVector_byte16_t_O : public template_Vector<ComplexVector_byte16_t_O, SimpleVector_byte16_t_O, ComplexVector_O> {
LISP_CLASS(core, CorePkg, ComplexVector_byte16_t_O, "ComplexVector_byte16_t", ComplexVector_O);
virtual ~ComplexVector_byte16_t_O(){};

public:
typedef template_Vector<ComplexVector_byte16_t_O, SimpleVector_byte16_t_O, ComplexVector_O> TemplatedBase;
Expand Down Expand Up @@ -124,7 +120,6 @@ class SimpleVector_int16_t_O;
typedef template_SimpleVector<SimpleVector_int16_t_O, int16_t, AbstractSimpleVector_O> specialized_SimpleVector_int16_t;
class SimpleVector_int16_t_O : public specialized_SimpleVector_int16_t {
LISP_CLASS(core, CorePkg, SimpleVector_int16_t_O, "SimpleVector_int16_t", AbstractSimpleVector_O);
virtual ~SimpleVector_int16_t_O(){};

public:
typedef specialized_SimpleVector_int16_t TemplatedBase;
Expand Down Expand Up @@ -154,7 +149,6 @@ class SimpleVector_int16_t_O : public specialized_SimpleVector_int16_t {
namespace core {
class MDArray_int16_t_O : public template_Array<MDArray_int16_t_O, SimpleMDArray_int16_t_O, SimpleVector_int16_t_O, MDArray_O> {
LISP_CLASS(core, CorePkg, MDArray_int16_t_O, "MDArray_int16_t", MDArray_O);
virtual ~MDArray_int16_t_O(){};

public:
typedef template_Array<MDArray_int16_t_O, SimpleMDArray_int16_t_O, SimpleVector_int16_t_O, MDArray_O> TemplatedBase;
Expand All @@ -168,7 +162,6 @@ class MDArray_int16_t_O : public template_Array<MDArray_int16_t_O, SimpleMDArray
namespace core {
class SimpleMDArray_int16_t_O : public template_SimpleArray<SimpleMDArray_int16_t_O, SimpleVector_int16_t_O, SimpleMDArray_O> {
LISP_CLASS(core, CorePkg, SimpleMDArray_int16_t_O, "SimpleMDArray_int16_t", SimpleMDArray_O);
virtual ~SimpleMDArray_int16_t_O(){};

public:
typedef template_SimpleArray<SimpleMDArray_int16_t_O, SimpleVector_int16_t_O, SimpleMDArray_O> TemplatedBase;
Expand All @@ -181,7 +174,6 @@ class SimpleMDArray_int16_t_O : public template_SimpleArray<SimpleMDArray_int16_
namespace core {
class ComplexVector_int16_t_O : public template_Vector<ComplexVector_int16_t_O, SimpleVector_int16_t_O, ComplexVector_O> {
LISP_CLASS(core, CorePkg, ComplexVector_int16_t_O, "ComplexVector_int16_t", ComplexVector_O);
virtual ~ComplexVector_int16_t_O(){};

public:
typedef template_Vector<ComplexVector_int16_t_O, SimpleVector_int16_t_O, ComplexVector_O> TemplatedBase;
Expand Down
Loading

0 comments on commit 976dbc4

Please sign in to comment.