You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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 :
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
The text was updated successfully, but these errors were encountered: