<commit_before>#include "bindTag.hpp"
#include "../interface/instancer.hpp"
#include "../binder/tbindable.inl"

namespace wrd {

    WRD_DEF_ME(bindTag)

    me::bindTag() : _pt(NULL), _strong(0) {}
    me::bindTag(id newId) : _pt(NULL), _strong(0), _id(newId) {}
    me::~bindTag() {
        _id.serial = 0;
    }

    const chunk& me::getChunk() const {
        if(!_pt)
            return nulOf<chunk>();

        return instancer::get().getPool()[*_pt][*_pt];
    }

    wcnt me::getStrongCnt() const { return _strong; }

    wbool me::unbind() {
        if(_pt && _id.isHeap()) {
            WRD_DI("bindTag(chkN=%d) deletes instance(%x)", _id.chkN, _pt);
            delete _pt;
        }

        _pt = nullptr;
        _strong = 0;
        return true;
    }

    wbool me::isBind() const { return _pt; }
    const type& me::getBindable() const { return ttype<instance>::get(); }<commit_msg>- [memlite] set not to log when release instance by bindTag. * it makes hard to analyze log files.<commit_after>#include "bindTag.hpp"
#include "../interface/instancer.hpp"
#include "../binder/tbindable.inl"

namespace wrd {

    WRD_DEF_ME(bindTag)

    me::bindTag() : _pt(NULL), _strong(0) {}
    me::bindTag(id newId) : _pt(NULL), _strong(0), _id(newId) {}
    me::~bindTag() {
        _id.serial = 0;
    }

    const chunk& me::getChunk() const {
        if(!_pt)
            return nulOf<chunk>();

        return instancer::get().getPool()[*_pt][*_pt];
    }

    wcnt me::getStrongCnt() const { return _strong; }

    wbool me::unbind() {
        if(_pt && _id.isHeap())
            delete _pt;

        _pt = nullptr;
        _strong = 0;
        return true;
    }

    wbool me::isBind() const { return _pt; }
    const type& me::getBindable() const { return ttype<instance>::get(); }
{'fraction_non_alphanumeric': 0.16768802228412255, 'fraction_numerical': 0.004456824512534819, 'mean_word_length': 2.549407114624506, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1347846', 'n_tokens_mistral': 647, 'n_tokens_neox': 628, 'n_words': 136}