diff --git a/dub.json b/dub.json index d966fa9..cf9817f 100644 --- a/dub.json +++ b/dub.json @@ -13,8 +13,11 @@ "cd $PACKAGE_DIR && git clone --recursive https://github.com/ErnyTech/neomimalloc || true", "cd $PACKAGE_DIR/neomimalloc/source/mimalloc && rm -rf build && mkdir build && cd build && cmake -DMI_OVERRIDE=OFF .. && make" ], - "sourceFiles": [ - "$PACKAGE_DIR/neomimalloc/source/mimalloc/build/libmimalloc.a" + "libs-posix" : [ + ":libmimalloc.a" + ], + "lflags-posix" : [ + "-L$PACKAGE_DIR/neomimalloc/source/mimalloc/build" ] }, { @@ -23,8 +26,11 @@ "cd $PACKAGE_DIR && git clone --recursive https://github.com/ErnyTech/neomimalloc || true", "cd $PACKAGE_DIR/neomimalloc/source/mimalloc && rm -rf build && mkdir build && cd build && cmake -DMI_OVERRIDE=OFF -DMI_SECURE=ON .. && make" ], - "sourceFiles": [ - "$PACKAGE_DIR/neomimalloc/source/mimalloc/build/libmimalloc-secure.a" + "libs-posix" : [ + ":ibmimalloc-secure.a" + ], + "lflags-posix" : [ + "-L$PACKAGE_DIR/neomimalloc/source/mimalloc/build" ] }, { @@ -33,8 +39,11 @@ "cd $PACKAGE_DIR && git clone --recursive https://github.com/ErnyTech/neomimalloc || true", "cd $PACKAGE_DIR/neomimalloc/source/mimalloc && rm -rf build && mkdir build && cd build && cmake -DMI_OVERRIDE=ON .. && make" ], - "sourceFiles": [ - "$PACKAGE_DIR/neomimalloc/source/mimalloc/build/libmimalloc.a" + "libs-posix" : [ + ":libmimalloc.a" + ], + "lflags-posix" : [ + "-L$PACKAGE_DIR/neomimalloc/source/mimalloc/build" ] }, { @@ -43,8 +52,11 @@ "cd $PACKAGE_DIR && git clone --recursive https://github.com/ErnyTech/neomimalloc || true", "cd $PACKAGE_DIR/neomimalloc/source/mimalloc && rm -rf build && mkdir build && cd build && cmake -DMI_OVERRIDE=ON -DMI_SECURE=ON .. && make" ], - "sourceFiles": [ - "$PACKAGE_DIR/neomimalloc/source/mimalloc/build/libmimalloc-secure.a" + "libs-posix" : [ + ":ibmimalloc-secure.a" + ], + "lflags-posix" : [ + "-L$PACKAGE_DIR/neomimalloc/source/mimalloc/build" ] }, { diff --git a/source/neomimalloc/mimallocator.d b/source/neomimalloc/mimallocator.d index 99259d9..ef81dda 100644 --- a/source/neomimalloc/mimallocator.d +++ b/source/neomimalloc/mimallocator.d @@ -202,7 +202,7 @@ struct Mimallocator { } auto sizeOfP = mi_usable_size(p); - result = p[0 .. sizeOfP]; + result = (cast(void*) p)[0 .. sizeOfP]; return Ternary.yes; } @@ -233,6 +233,6 @@ struct Mimallocator { return false; } - return mi_check_owned(b.ptr); + return mi_check_owned(p); } -} \ No newline at end of file +}