gc.inline.h 721 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef AFUN_GC_INLINE_H
  2. #define AFUN_GC_INLINE_H
  3. #include "gc.h"
  4. namespace aFuncore {
  5. inline GcObjectBase::GcObjectBase() : not_clear{false}, reference{0}, reachable{false} {
  6. }
  7. inline void GcObjectBase::addReference() {
  8. reference++;
  9. }
  10. inline void GcObjectBase::delReference() {
  11. reference--;
  12. }
  13. inline void GcObjectBase::setClear(bool clear) {
  14. not_clear=!clear;
  15. }
  16. inline void GcObjectBase::setReachable(bool is_reference) {
  17. reachable=is_reference;
  18. }
  19. inline size_t GcList::getSize() const {
  20. return queue.size();
  21. }
  22. inline size_t GcList::isEmpty() const {
  23. return queue.empty();
  24. }
  25. }
  26. #endif //AFUN_GC_INLINE_H