Cuberite
A lightweight, fast and extensible game server for Minecraft
Macros
ByteBuffer.cpp File Reference
#include "Globals.h"
#include "ByteBuffer.h"
#include "Endianness.h"
#include "UUID.h"
#include "OSSupport/IsThread.h"
Include dependency graph for ByteBuffer.cpp:

Go to the source code of this file.

Macros

#define CHECK_THREAD
 
#define MAX_STRING_SIZE   (512 KiB)
 When defined, each access to a cByteBuffer object is checked whether it's done in the same thread. More...
 
#define NEEDBYTES(Num)   if (!CanReadBytes(Num)) return false
 
#define PUTBYTES(Num)   if (!CanWriteBytes(Num)) return false
 

Macro Definition Documentation

◆ CHECK_THREAD

#define CHECK_THREAD

Definition at line 75 of file ByteBuffer.cpp.

◆ MAX_STRING_SIZE

#define MAX_STRING_SIZE   (512 KiB)

When defined, each access to a cByteBuffer object is checked whether it's done in the same thread.

cByteBuffer assumes that it is not used by multiple threads at once, this macro adds a runtime check for that. Unfortunately it is very slow, so it is disabled even for regular DEBUG builds.

Definition at line 27 of file ByteBuffer.cpp.

◆ NEEDBYTES

#define NEEDBYTES (   Num)    if (!CanReadBytes(Num)) return false

Definition at line 29 of file ByteBuffer.cpp.

◆ PUTBYTES

#define PUTBYTES (   Num)    if (!CanWriteBytes(Num)) return false

Definition at line 30 of file ByteBuffer.cpp.