1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00
srs/trunk/src/protocol/srs_protocol_conn.cpp
Winlin 6f3d6b9b65
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
2022-12-20 19:54:25 +08:00

74 lines
825 B
C++

//
// Copyright (c) 2013-2022 The SRS Authors
//
// SPDX-License-Identifier: MIT or MulanPSL-2.0
//
#include <srs_protocol_conn.hpp>
#include <srs_kernel_error.hpp>
#include <algorithm>
using namespace std;
ISrsResource::ISrsResource()
{
}
ISrsResource::~ISrsResource()
{
}
std::string ISrsResource::desc()
{
return "Resource";
}
ISrsResourceManager::ISrsResourceManager()
{
}
ISrsResourceManager::~ISrsResourceManager()
{
}
ISrsConnection::ISrsConnection()
{
}
ISrsConnection::~ISrsConnection()
{
}
SrsLazyObject::SrsLazyObject()
{
gc_ref_ = 0;
}
SrsLazyObject::~SrsLazyObject()
{
}
void SrsLazyObject::gc_use()
{
gc_ref_++;
}
void SrsLazyObject::gc_dispose()
{
gc_ref_--;
}
int32_t SrsLazyObject::gc_ref()
{
return gc_ref_;
}
ISrsLazyGc::ISrsLazyGc()
{
}
ISrsLazyGc::~ISrsLazyGc()
{
}