| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| DynamicArrays-1.05.zip | 2026-05-21 | 417.0 kB | |
| Totals: 1 Item | 417.0 kB | 4 | |
π¦ Dynamic Arrays and Hashes (Delphi, C++)
A high-performance library providing advanced dynamic array and hash table data structures for Delphi and C++.
This project focuses on fast in-memory data manipulation, offering functionality beyond standard containers, including optimized operations and flexible memory control.
Web site: https://sourceforge.net/projects/dynamicarrays/
Author: Andrey Romanchenko lasersquad@gmail.com
π Features
Core Capabilities
- High-performance dynamic arrays implementations
- Advanced hash tables:
- THash<K, V> β key-value storage
- THash2<K1, K2, V> β dual-key storage
- Efficient memory management and flexible allocation strategies
- Optimized operations (including low-level/assembler optimizations for x86/x64)
Containers & Data Structures
C++
- General purpose fast C++ container THarray<T>
- THArraySorted<T> β maintains sorted elements for faster lookup
- THArrayAuto<T> β automatically resizable container. Never generates an exceptions like "Index out of bounds."
- THArrayRaw - useful for storing untyped data (considers data as bytes in memory)
- Iterators compatible with STL
Delphi
- THArrayG<T> - generic general purpose container
- Old fashion set of containers like THarrayInteger, THArrayObject, THArrayInt64 and many others (all Delphi main data types are covered, see DynamicArrays.pas unit)
- Special containers for fixed size string-like data, useful for working with databases - THArrayStringFix, THArrayAnsiStringFix.
Hashing Classes
- THash<K, V> and THash2<K1, K2, V> store values available by one or two indexes. Indexes can be any type.
- Fast lookup and indexing improvements using sorted arrays
- Support for existence-only hashes (THashExists, THash2Exists)
- Optimized IndexOf() operations through sorted backing structures
π§± Project Structure
Typical repository layout:
dynamicarrays/
βββ src/ # Core source code (Delphi + C++)
βββ tests/ # Unit tests for C++ arrays and hashes
βββ prj/ # Unit tests projects to run in Delphi or VisualStudio
βββ docs/ # Documentation (partial)
βββ build/ # build scripts for releases
βοΈ Requirements
Supported Platforms
- Delphi - starting from Delphi7, latest versions fully supported, including Delphi 13+
- C++
- Visual Studio (2022+)
- GCC (Linux)
Architecture
Dynamic Arrays can be compiled for both x86 and x64 architectures
Performance Notes
- Designed for high-speed operations in memory
- Uses optimized algorithms and, in some cases, low-level assembler routines
- Improved lookup performance using sorted internal structures
- Faster alternatives to standard containers in certain scenarios
License
Licensed under: GNU General Public License v2.0 (GPLv2)
π οΈ Installation
Option 1 β Clone repository
git clone https://git.code.sf.net/p/dynamicarrays/code.git
cd code
Option 2 β Download release
Download the latest archive from SourceForge: latest version
βΆοΈ Usage
THArray Example
#include "DynamicArrays.h"
THArray<int> arr;
arr.Add(10);
arr.Add(20);
int value = arr[0];
THash Example
#include "DynamicArrays.h"
THash<std::string, int> hash;
hash.Add("key", 42);
int result = hash["key"];
Delphi Example
var
arr: THArrayG<Integer>;
val: Integer;
begin
arr := THArrayG<Integer>.Create;
arr.Add(10);
arr.Add(20);
val := arr[1];
end;
For more usage scenarios see unit-tests in prj folder.