summaryrefslogtreecommitdiff
path: root/src/util/pointer.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-08-25 15:53:56 +0200
committerGitHub <noreply@github.com>2017-08-25 15:53:56 +0200
commit3cea7a349ac55df93b3eac1bf40365e00e472480 (patch)
treef1b45da38389e406c242d83f581f016f542b9300 /src/util/pointer.h
parentf6a33a1a7a298cb7d3fb18818bae97bd1b89d633 (diff)
downloadminetest-3cea7a349ac55df93b3eac1bf40365e00e472480.tar.gz
minetest-3cea7a349ac55df93b3eac1bf40365e00e472480.tar.bz2
minetest-3cea7a349ac55df93b3eac1bf40365e00e472480.zip
Network cleanup (#6310)
* Move Connection threads to dedicated files + various cleanups * ConnectionReceiveThread::processPacket now uses function pointer table to route MT packet types * Various code style fixes * Code style with clang-format * Various SharedBuffer copy removal * SharedBuffer cannot be copied anymore using Buffer * Fix many SharedBuffer copy (thanks to delete operator)
Diffstat (limited to 'src/util/pointer.h')
-rw-r--r--src/util/pointer.h22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/util/pointer.h b/src/util/pointer.h
index f018efb20..efca62d2d 100644
--- a/src/util/pointer.h
+++ b/src/util/pointer.h
@@ -104,7 +104,6 @@ private:
/************************************************
* !!! W A R N I N G !!! *
- * !!! A C H T U N G !!! *
* *
* This smart pointer class is NOT thread safe. *
* ONLY use in a single-threaded context! *
@@ -134,7 +133,6 @@ public:
}
SharedBuffer(const SharedBuffer &buffer)
{
- //std::cout<<"SharedBuffer(const SharedBuffer &buffer)"<<std::endl;
m_size = buffer.m_size;
data = buffer.data;
refcount = buffer.refcount;
@@ -142,7 +140,6 @@ public:
}
SharedBuffer & operator=(const SharedBuffer & buffer)
{
- //std::cout<<"SharedBuffer & operator=(const SharedBuffer & buffer)"<<std::endl;
if(this == &buffer)
return *this;
drop();
@@ -171,19 +168,6 @@ public:
/*
Copies whole buffer
*/
- SharedBuffer(const Buffer<T> &buffer)
- {
- m_size = buffer.getSize();
- if(m_size != 0)
- {
- data = new T[m_size];
- memcpy(data, *buffer, buffer.getSize());
- }
- else
- data = NULL;
- refcount = new unsigned int;
- (*refcount) = 1;
- }
~SharedBuffer()
{
drop();
@@ -220,9 +204,3 @@ private:
unsigned int m_size;
unsigned int *refcount;
};
-
-inline SharedBuffer<u8> SharedBufferFromString(const char *string)
-{
- SharedBuffer<u8> b((u8*)string, strlen(string)+1);
- return b;
-}