projects
/
software
/
dgc
/
naive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6720d9b
)
When doing a realloc(), take the size of the type into account
author
Alberto Bertogli
<albertito@blitiri.com.ar>
Fri, 15 May 2009 02:18:07 +0000
(23:18 -0300)
committer
Leandro Lucarella
<llucax@gmail.com>
Sun, 17 May 2009 21:04:01 +0000
(18:04 -0300)
gc/dynarray.d
patch
|
blob
|
history
diff --git
a/gc/dynarray.d
b/gc/dynarray.d
index f0d5218b7dce1c968f59af781c6c20292954aabb..9836258ccda597e323ba6b2b432268e297bd3228 100644
(file)
--- a/
gc/dynarray.d
+++ b/
gc/dynarray.d
@@
-106,7
+106,7
@@
public:
if (new_capacity == 0)
new_capacity = 4;
// reallocate the memory with the new_capacity
- T* new_data = cast(T*) realloc(this.data, new_capacity);
+ T* new_data = cast(T*) realloc(this.data, new_capacity
* T.sizeof
);
if (new_data is null)
onOutOfMemoryError();
this.data = new_data;