aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar gingerBill 2015-11-28 22:55:24 +0000
committerGravatar gingerBill 2015-11-28 22:55:24 +0000
commit16c31df7122df448bb68fe25a5244b9b8a22c22c (patch)
tree09eb632f18e46e504449771d13ef4921dd85a754
parentgb.hpp v0.25 - gb_math.hpp v0.03 (diff)
Array bug fix
-rw-r--r--README.md2
-rw-r--r--gb.hpp21
2 files changed, 12 insertions, 11 deletions
diff --git a/README.md b/README.md
index a05ec2e..70a2462 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ gb single-file public domain libraries for C & C++
library | latest version | category | languages | description
----------------|----------------|----------|-----------|-------------
**gb_string.h** | 0.93 | strings | C, C++ | A better string library for C & C++
-**gb.hpp** | 0.25 | misc | C++11 | (Experimental) A C++11 helper library without STL geared towards game development
+**gb.hpp** | 0.25a | misc | C++11 | (Experimental) A C++11 helper library without STL geared towards game development
**gb_math.hpp** | 0.02b | math | C++11 | A C++11 math library geared towards game development
**gb_ini.h** | 0.91a | misc | C, C++ | A simple ini file loader library for C & C++
diff --git a/gb.hpp b/gb.hpp
index 56237cf..3a39f4d 100644
--- a/gb.hpp
+++ b/gb.hpp
@@ -1,4 +1,4 @@
-// gb.hpp - v0.25 - public domain C++11 helper library - no warranty implied; use at your own risk
+// gb.hpp - v0.25a - public domain C++11 helper library - no warranty implied; use at your own risk
// (Experimental) A C++11 helper library without STL geared towards game development
/*
@@ -1532,10 +1532,10 @@ Array<T>::Array(const Array<T>& other)
, capacity(0)
, data(nullptr)
{
- const auto count = other.count;
- array::set_capacity(this, count);
- memory::copy_array(other.data, count, data);
- count = n;
+ const auto new_count = other.count;
+ array::set_capacity(this, new_count);
+ memory::copy_array(other.data, new_count, data);
+ this->count = new_count;
}
template <typename T>
@@ -1565,9 +1565,9 @@ Array<T>::operator=(const Array<T>& other)
{
if (allocator == nullptr)
allocator = other.allocator;
- const auto count = other.count;
- array::resize(this, count);
- memory::copy_count(other.data, count, data);
+ const auto new_count = other.count;
+ array::resize(this, new_count);
+ memory::copy_array(other.data, new_count, data);
return *this;
}
@@ -3265,9 +3265,9 @@ free(String str)
{
if (str == nullptr)
return;
-
+
string::Header* h = string::header(str);
-
+
if (h->allocator)
dealloc(h->allocator, h);
}
@@ -4348,6 +4348,7 @@ __GB_NAMESPACE_END
/*
Version History:
+ 0.25a - Array bug fix
0.25 - Faster Heap_Allocator for Windows using HeapAlloc
0.24b - Even More Hash_Table Bug Fixes
0.24a - Hash_Table Bug Fixes