emeryberger / heap-layers Goto Github PK
View Code? Open in Web Editor NEWHeap Layers: An Extensible Memory Allocation Infrastructure
License: Apache License 2.0
Heap Layers: An Extensible Memory Allocation Infrastructure
License: Apache License 2.0
GCC: gcc version 4.4.6
OS: CentOS release 6.2
CPU: Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
$ uname -p
x86_64
$ make linux-gcc-x86-64
g++ -pedantic -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wno-ctor-dtor-privacy -Wno-overlength-strings -Wno-invalid-offsetof -Wno-variadic-macros -Wcast-align -Wno-long-long -pthread -pipe -DNDEBUG -W -Wall -O3 -DNDEBUG -pipe -fPIC -m64 -march=nocona -ffast-math -g -I. -Iinclude -Iinclude/layers -Iinclude/util -Iinclude/math -Iinclude/static -Iinclude/rng -Iinclude/hoard -Iinclude/superblocks -IHeap-Layers -DDIEHARD_DIEHARDER=0 -D_REENTRANT=1 -DDIEHARD_MULTITHREADED=1 -shared -D'CUSTOM_PREFIX(x)=diehard##x' Heap-Layers/wrappers/gnuwrapper.cpp source/libdieharder.cpp -Bsymbolic -o libdiehard.so -ldl -lpthread
Heap-Layers/wrappers/gnuwrapper.cpp:213: warning: unused parameter 'param'
Heap-Layers/wrappers/gnuwrapper.cpp:213: warning: unused parameter 'value'
Heap-Layers/wrappers/gnuwrapper.cpp:218: warning: unused parameter 'pad'
Heap-Layers/wrappers/gnuwrapper.cpp:231: warning: unused parameter 'ptr'
In file included from include/randomminiheap.h:25,
from include/diehardheap.h:33,
from source/libdieharder.cpp:41:
include/util/madvisewrapper.h:62: warning: unused parameter 'ptr'
include/util/madvisewrapper.h:62: warning: unused parameter 'sz'
In file included from include/dieharder-pagetable.h:13,
from include/randomminiheap-dieharder.h:7,
from include/randomminiheap.h:44,
from include/diehardheap.h:33,
from source/libdieharder.cpp:41:
include/randommmap.h: In constructor 'RandomMmap::RandomMmap()':
include/randommmap.h:37: error: 'protect' is not a member of 'HL::MmapWrapper'
include/randommmap.h: In member function 'void* RandomMmap::map(size_t)':
include/randommmap.h:77: error: 'unprotect' is not a member of 'HL::MmapWrapper'
include/randommmap.h: In member function 'void RandomMmap::unmap(void_, size_t)':
include/randommmap.h:102: error: 'protect' is not a member of 'HL::MmapWrapper'
In file included from Heap-Layers/wrappers/all.h:1,
from Heap-Layers/heaplayers.h:109,
from source/libdieharder.cpp:29:
Heap-Layers/wrappers/ansiwrapper.h: In constructor 'HL::ANSIWrapper::ANSIWrapper() [with SuperHeap = HL::LockedHeap<PosixSpinLockType, CombineHeap<DieHardHeap<8, 7, 4096, false, false>, TheLargeHeap> >]':
source/libdieharder.cpp:92: instantiated from here
Heap-Layers/wrappers/ansiwrapper.h:30: warning: unused variable 'checkAlignment'
make: *_* [linux-gcc-x86-64] Error 1
class Arena {
Arena * nextArena;
char * arenaSpace;
// long long _dummy; // For alignment.
};
Why it needs a _dummy here? In codemonkey, sizeof(long long) is only 8 bytes. I guess that this works for other machines too. That actually lead to a problem of alignment. two dummys should work better.
Anything after 5808161 no longer builds on Windows as tprintf.h assumes various things that won't exist on Windows.
Failing to compile on VS 2015. Its looking for file stdalign.h.
cl /I. /Iinclude /Iinclude/util /Iinclude/hoard /Iinclude/superblocks /IHeap-Layers /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_WINRT_DLL" /D "_UNICODE" /D "UNICODE" /Zi /Ox /MD /nologo /W1 /WX- /Ox /Oi /Oy- /Gm- /EHsc /MD /GS /Gy /Zc:wchar_t /Zc:forScope /Gd /errorReport:queue "source\libhoard.cpp" "Heap-Layers\wrappers\winwrapper.cpp" "source\wintls.cpp" /GL /link /DLL /subsystem:console /OUT:libhoard.dll libhoard.cpp d:\dev\hoard\src\heap-layers\wrappers\ansiwrapper.h(9): fatal error C1083: Cannot open include file: 'stdalign.h': No such file or directory
gcc version 4.4.6
Hi,
i'm try to build a simple memory allocator(as an assignment poject) and i found Heap layers very interesting
using Allocator = FreelistHeap<ZoneHeap<SizedMmapHeap, 1024 * 8>>;
when defining my allocator as shown above i don't get 16 byte aligned address
after reading the source code i have found :
class Arena {
public:
Arena() {
static_assert((sizeof(Arena) % MallocInfo::Alignment == 0),
"Alignment must match Arena size.");
}
Arena * nextArena;
char * arenaSpace;
size_t arenaSize;
};
as Arena is never instantiated explicitly the static_assert fail silently i don't know if it's intentional, in my case i added a dummy
pointer to solve the problem (is there a better solution or am i using heap layer the wrong way)
thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.