diff --git a/upptst/Memory/Memory.cpp b/upptst/Memory/Memory.cpp new file mode 100644 index 000000000..728a07fe7 --- /dev/null +++ b/upptst/Memory/Memory.cpp @@ -0,0 +1,23 @@ +#include + +using namespace Upp; + +void Test(int ini, int re) +{ + RLOG("----------"); + RLOG("Test trying realloc from " << ini << " to " << re); + byte *h = new byte[ini]; + + RDUMP(GetMemoryBlockSize(h)); + RDUMP(TryRealloc(h, re)); + RDUMP(GetMemoryBlockSize(h)); +} + +CONSOLE_APP_MAIN +{ + Test(200, 220); + Test(194, 204); + Test(2000, 2273); + Test(500000, 600000); + Test(500000, 500002); +} diff --git a/upptst/Memory/Memory.upp b/upptst/Memory/Memory.upp new file mode 100644 index 000000000..06bbf35d4 --- /dev/null +++ b/upptst/Memory/Memory.upp @@ -0,0 +1,9 @@ +uses + Core; + +file + Memory.cpp; + +mainconfig + "" = "SSE2"; +