Toggle navigation
Beam GIT List
GitHub
Repo
Changelog
To do
Releases
Themes
Change log
Loading change log ...
To do ...
Loading todo ...
browsing:
bdbf10d4dfd924f118dc29da98a22199724c7962
Branches
master
Tags
tms/release-pre-2.1.0
tms/release-2.2.1
tms/release-2.2.0
tms/release-2.1.0
tms/release-2.0.6
tms/release-2.0.5
tms/release-2.0.4
tms/release-2.0.3first
tms/release-2.0.3
tms/release-1.2.12
tms/release-1.2.11
tms/release-1.2.10
tms/release-1.2.9
tms/release-1.2.8
tms/release-1.2.6a
tms/release-1.2.6
tms/release-1.2.4
tms/release-1.2.3
tms/release-1.2.2
tms/release-1.2.0
tms/release-1.1.2
tms/release-1.1.1
tms/release-1.0.2
tms/release-1.0.1
tms/release-1.0.0
tms/release-0.4.3
tms/release-0.4.2
tms/release-0.4.1
tms/release-0.3.14
tms/release-0.3.13
tms/release-0.3.12
tms/release-0.3.10
tms/release-0.3.9
tms/release-0.3.8
tms/release-0.3.5
tms/release-0.3.4
tms/release-0.3.3
tms/release-0.2.7
tms/release-0.2.5
tms/release-0.2.3
tms-mcsys/release-2.1.0-1.beam
tms-mcsys/release-2.0.6-1.beam
tms-mcsys/release-1.2.9-1.beam
tms-fpga/release-1.2.5
tms-fpga/release-1.2.4
Files
Commits
Log
Graph
Stats
tms-old
beam
libBeam
BRefData.cpp
RSS
Git
Fetch origin
Download
ZIP
TAR
Clone
Raw
View
History
Clone
HTTPS
Blames found: 25
Mode: text/x-c++src
Binary: false
Hang on, we reloading big blames...
6ae0d525
/******************************************************************************* * BRefData.cc Referenced data storage * T.Barnaby, Beam Ltd, 6/10/94 ******************************************************************************* */
57456599
#include <stdio.h>
6ae0d525
#include <stdlib.h> #include <string.h>
57456599
#include <BRefData.h>
6ae0d525
#define CHUNK 16 BRefData::BRefData(){
57456599
odata = 0; olen = 0; orefCount = 1;
6ae0d525
} BRefData::BRefData(int len){
57456599
odata = 0; olen = 0; orefCount = 1;
6ae0d525
setLen(len); } BRefData::BRefData(const BRefData& refData){
57456599
olen = refData.olen; odata = malloc(olen); memcpy(odata, refData.odata, olen); orefCount = 1;
6ae0d525
}
57456599
BRefData& BRefData::operator=(const BRefData& refData){ free(odata); olen = refData.olen; odata = malloc(olen); memcpy(odata, refData.odata, olen); orefCount = 1;
6ae0d525
return *this; } BRefData::~BRefData(){
57456599
free(odata); odata = 0; olen = 0; orefCount = 0;
6ae0d525
} BRefData* BRefData::copy(){ BRefData* r = this;
57456599
if(++orefCount > 2){
6ae0d525
r = new BRefData(*this);
57456599
orefCount.add(-2); } else { orefCount--;
6ae0d525
} return r; } BRefData* BRefData::addRef(){
57456599
orefCount++;
6ae0d525
return this; } int BRefData::deleteRef(){
57456599
return --orefCount;
6ae0d525
} void BRefData::setLen(int len){
57456599
olen = len; odata = realloc(odata, olen);
6ae0d525
}