1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

GB: Refine lazy object GC. v5.0.114 (#3321)

* GB: Refine lazy object GC.

1. Remove gc_set_creator_wrapper, pass by resource constructor.
2. Remove SRS_LAZY_WRAPPER_GENERATOR macro, use template directly.
3. Remove interfaces ISrsGbSipConn and ISrsGbSipConnWrapper.
4. Remove ISrsGbMediaConn and ISrsGbMediaConnWrapper.

* GC: Refine wrapper constructor.

* GB: Refine lazy object GC. v5.0.114
This commit is contained in:
Winlin 2022-12-20 19:54:25 +08:00 committed by GitHub
parent 7eaee46f1f
commit 6f3d6b9b65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 104 additions and 223 deletions

View file

@ -43,23 +43,20 @@ ISrsConnection::~ISrsConnection()
SrsLazyObject::SrsLazyObject()
{
gc_ref_ = 0;
gc_creator_wrapper_ = NULL;
}
SrsLazyObject::~SrsLazyObject()
{
}
SrsLazyObject* SrsLazyObject::gc_use()
void SrsLazyObject::gc_use()
{
gc_ref_++;
return this;
}
SrsLazyObject* SrsLazyObject::gc_dispose()
void SrsLazyObject::gc_dispose()
{
gc_ref_--;
return this;
}
int32_t SrsLazyObject::gc_ref()
@ -67,16 +64,6 @@ int32_t SrsLazyObject::gc_ref()
return gc_ref_;
}
void SrsLazyObject::gc_set_creator_wrapper(ISrsResource* wrapper)
{
gc_creator_wrapper_ = wrapper;
}
ISrsResource* SrsLazyObject::gc_creator_wrapper()
{
return gc_creator_wrapper_;
}
ISrsLazyGc::ISrsLazyGc()
{
}