summaryrefslogtreecommitdiff
path: root/Source/Kernel/Library/Vector.class.cpp
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-09-13 16:46:15 +0200
committerAlexis211 <alexis211@gmail.com>2009-09-13 16:46:15 +0200
commit708765621ede3541037fb822cc032b9feb2ea43e (patch)
tree12e0e6c936fba8092479baf31d2ac4dc4ea9ed0f /Source/Kernel/Library/Vector.class.cpp
parentace1914398633e05970f634ddec297665dfda7c6 (diff)
downloadMelon-708765621ede3541037fb822cc032b9feb2ea43e.tar.gz
Melon-708765621ede3541037fb822cc032b9feb2ea43e.zip
Kernel can now load an Initrd.
Diffstat (limited to 'Source/Kernel/Library/Vector.class.cpp')
-rw-r--r--Source/Kernel/Library/Vector.class.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/Kernel/Library/Vector.class.cpp b/Source/Kernel/Library/Vector.class.cpp
index d0c71a4..91196b8 100644
--- a/Source/Kernel/Library/Vector.class.cpp
+++ b/Source/Kernel/Library/Vector.class.cpp
@@ -2,18 +2,22 @@ using namespace CMem; //strlen and memcpy
template <typename T>
Vector<T>::Vector() {
+ //DEBUG_HEX((u32int)this); DEBUG(" NEW EMPTY");
+ //DEBUG_HEX(sizeof(T)); DEBUG(" sizeof(T)");
m_data = 0;
m_size = 0;
}
template <typename T>
Vector<T>::Vector(u32int size) {
+ //DEBUG_HEX((u32int)this); DEBUG(" NEW ZERO");
m_data = new T[size];
m_size = size;
}
template <typename T>
Vector<T>::Vector(u32int size, T value) {
+ //DEBUG_HEX((u32int)this); DEBUG(" NEW FILLED");
//m_data = (T*)Mem::kalloc(size * sizeof(T));
m_data = new T[size](value);
m_size = size;
@@ -24,6 +28,7 @@ Vector<T>::Vector(u32int size, T value) {
template <typename T>
Vector<T>::Vector(const Vector<T> &other) {
+ //DEBUG_HEX((u32int)this); DEBUG(" COPY REF");
m_size = other.m_size;
m_data = (T*)Mem::kalloc(m_size * sizeof(T));
for (u32int i = 0; i < m_size; i++) {
@@ -33,6 +38,7 @@ Vector<T>::Vector(const Vector<T> &other) {
template <typename T>
Vector<T>& Vector<T>::operator= (const Vector<T> &other) {
+ //DEBUG_HEX((u32int)this); DEBUG(" COPY EQ");
if (m_data != 0) delete[] m_data;
m_size = other.m_size;
m_data = (T*)Mem::kalloc(m_size * sizeof(T));
@@ -43,6 +49,7 @@ Vector<T>& Vector<T>::operator= (const Vector<T> &other) {
template <typename T>
Vector<T>::~Vector() {
+ //DEBUG_HEX((u32int)this); DEBUG(" DELETE");
if (m_data != 0) delete[] m_data;
}
@@ -107,7 +114,7 @@ bool Vector<T>::empty() {
template <typename T>
void Vector<T>::clear() {
if (empty()) return;
- Mem::kfree(m_data);
+ delete [] m_data;
m_data = 0;
m_size = 0;
}