Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PacketLib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andrea Bulgarelli
PacketLib
Commits
dff888c3
Commit
dff888c3
authored
11 years ago
by
Andrea Bulgarelli
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of github.com:ASTRO-BO/PacketLib
parents
d96ad954
7e5307d5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/ByteStream.h
+0
-8
0 additions, 8 deletions
include/ByteStream.h
include/SharedPtr.h
+1
-1
1 addition, 1 deletion
include/SharedPtr.h
src/ByteStream.cpp
+1
-51
1 addition, 51 deletions
src/ByteStream.cpp
src/SDFRBlock.cpp
+1
-2
1 addition, 2 deletions
src/SDFRBlock.cpp
with
3 additions
and
62 deletions
include/ByteStream.h
+
0
−
8
View file @
dff888c3
...
...
@@ -129,14 +129,6 @@ public:
/// Pointer to the stream
byte
*
stream
;
static
dword
count_object
;
static
dword
count_object2
;
static
dword
count_object_deleted
;
static
dword
count_object_deleted2
;
protected:
/// Internal use only for memory management
...
...
This diff is collapsed.
Click to expand it.
include/SharedPtr.h
+
1
−
1
View file @
dff888c3
...
...
@@ -32,7 +32,7 @@ class SharedPtr
SharedPtr
()
:
p
(
0
),
c
(
0
)
{}
explicit
SharedPtr
(
T
*
s
)
:
p
(
s
),
c
(
new
unsigned
(
1
))
{}
SharedPtr
(
int
null
)
:
p
(
0
),
c
(
0
)
{}
SharedPtr
(
void
*
null
)
:
p
(
0
),
c
(
0
)
{}
SharedPtr
(
const
SharedPtr
&
s
)
:
p
(
s
.
p
),
c
(
s
.
c
)
{
if
(
c
)
++*
c
;
}
...
...
This diff is collapsed.
Click to expand it.
src/ByteStream.cpp
+
1
−
51
View file @
dff888c3
...
...
@@ -21,14 +21,6 @@
#include
"Utility.h"
using
namespace
PacketLib
;
/// Objects that deallocate memory
dword
ByteStream
::
count_object
=
0
;
/// Objects that do not deallocate memory
dword
ByteStream
::
count_object2
=
0
;
dword
ByteStream
::
count_object_deleted
=
0
;
dword
ByteStream
::
count_object_deleted2
=
0
;
/// Returns a pointer of a field in the list of fields of this part of packet.
/// \remarks mem_allocation = true indicates that the allocated memory must be released by the destroyer.
/// \remarks memory_sharing=false In all methods of constructor or set type accepting byte*, it indicates that the swap is applied.
...
...
@@ -137,15 +129,9 @@ PacketLib::ByteStream::~ByteStream()
{
if
(
mem_allocation
)
{
ByteStream
::
count_object_deleted
++
;
//cout << "ByteStream::~ByteStream() delete[] stream;" << endl;
delete
[]
stream
;
stream
=
0
;
}
else
;
// ByteStream::count_object_deleted2++;
//cout << "ByteStream::~ByteStream()" << endl;
}
...
...
@@ -382,46 +368,10 @@ void PacketLib::ByteStream::swapWordIfStreamIsBigEndian()
}
}
void
PacketLib
::
ByteStream
::
setMemoryAllocated
(
bool
allocated
)
{
if
(
allocated
)
{
if
(
mem_allocation_constructor
)
{
ByteStream
::
count_object
++
;
}
else
{
if
(
mem_allocation
==
false
)
{
ByteStream
::
count_object2
--
;
ByteStream
::
count_object
++
;
}
}
mem_allocation
=
allocated
;
}
else
{
if
(
mem_allocation_constructor
)
{
ByteStream
::
count_object2
++
;
}
else
{
if
(
mem_allocation
==
true
)
{
ByteStream
::
count_object
--
;
ByteStream
::
count_object2
++
;
}
}
mem_allocation
=
allocated
;
}
}
void
PacketLib
::
ByteStream
::
deleteStreamMemory
()
{
...
...
This diff is collapsed.
Click to expand it.
src/SDFRBlock.cpp
+
1
−
2
View file @
dff888c3
...
...
@@ -39,7 +39,6 @@ bool SDFRBlock::loadFields(InputText& fp) throw(PacketException*)
{
try
{
char
*
line
;
numberOfRBlocks
=
1
;
rblockFilename
=
new
char
*
[
numberOfRBlocks
];
numberOfBlockFixed
[
0
]
=
true
;
...
...
@@ -56,7 +55,7 @@ bool SDFRBlock::loadFields(InputText& fp) throw(PacketException*)
block
[
0
].
loadFields
(
fp
);
fp
.
setpos
(
0
);
/// It gets the [Identifiers] section
line
=
fp
.
getLine
(
"[Identifiers]"
);
fp
.
getLine
(
"[Identifiers]"
);
return
true
;
}
catch
(
PacketExceptionIO
*
e
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment