Skip to content

Commit

Permalink
switch to use HashMap from emsi_containers instead of dlang built-in AA
Browse files Browse the repository at this point in the history
  • Loading branch information
yilabs committed Jun 16, 2023
1 parent 117e8cc commit 5681f0a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
36 changes: 28 additions & 8 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,37 @@
"authors": [
"mw66"
],
"configurations": [
{
"excludedSourceFiles": [],
"mainSourceFile": "source/app.d",
"name": "application",
"targetType": "executable"
},
{
"excludedSourceFiles": [
"source/app.d",
"source/app.d"
],
"name": "library",
"targetType": "library"
}
],
"copyright": "Copyright © 2020, mw66",
"dependencies": {
"fluent-asserts": "~>0.13.3",
"emsi_containers": "~>0.9.0"
},
"description": "Just-Do-It util mixin, some small util mixin to make life easier: string interpolation etc ...",
"importPaths": [
"source"
],
"lflags-linux": [],
"license": "BSL-1.0",
"name": "jdiutil",
"dependencies": {
"fluent-asserts": "~>0.13.3"
},
"preBuildCommands": [
"preBuildCommands": [],
"sourcePaths": [
"source"
],
"sourcePaths": ["source"],
"importPaths": ["source"],
"lflags-linux": [
]
"version": "1.2.1"
}
1 change: 1 addition & 0 deletions dub.selections.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"fileVersion": 1,
"versions": {
"ddmp": "0.0.1-0.dev.3",
"emsi_containers": "0.9.0",
"fluent-asserts": "0.13.3",
"libdparse": "0.14.0",
"stdx-allocator": "2.77.5"
Expand Down
6 changes: 5 additions & 1 deletion source/jdiutil/memory.d
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import std.experimental.logger;
import std.stdio;
import std.traits;

import containers.hashmap; // emsi_containers

version (unittest) {
public import fluent.asserts;
}
Expand Down Expand Up @@ -229,7 +231,9 @@ T dup(T)(T obj) if (is(T == class)) { // shallowClone
https://forum.dlang.org/post/xfjrizobwiidaiwylheq@forum.dlang.org
\* ========================================================================== */
class SharedAA(KeyT, ValT) { // wrapper class to make the inner `aa` acts like a class object
public ValT[KeyT] aa;
// https://forum.dlang.org/thread/vkkwysusmnivkooglgwd@forum.dlang.org
// life is too short to debug dlang built-in AA to right, let's just use HashMap from emsi_containers
public HashMap!(KeyT, ValT) aa;
alias aa this; // make the associative arrays syntax on SharedAA object to work

~this() {
Expand Down

0 comments on commit 5681f0a

Please sign in to comment.