Giter VIP home page Giter VIP logo

heap-layers's Issues

Compile Error: "error: 'protect' is not a member of 'HL::MmapWrapper'"

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

heaps/special/zoneheap.h alignment problem?

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.

Failing to compile 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

Question: how to get 16 byte aligned address using ZoneHeap?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.