Conversation
b020b58 to
dfe696f
Compare
dfe696f to
3e7fbb3
Compare
|
Thanks! .. but yikes, that can cause a lot of overhead just to support constructor contexts (which are the only feature that need to copy arbitrary blocks). As an aside, do you need to use the standard allocator on FreeBSD? |
I don't know about FreeBSD, but assuming you meant OpenBSD,
Maybe we could make constructor contexts carry their own size so that all other allocations don't have to. That seems a bit more involved than this PR though, especially if we don't want to have an impact on systems that do have a way to get an allocation's size. I'll try to look into it. |
|
Ah yes, OpenBSD. We can't really have just constructor contexts carry their size as they can switch between the actual type (say list) and their context. We could perhaps optimize a bit: for any regular type that does not have "raw" fields (like |
OpenBSD removed
malloc_usable_sizefrom libc in version 6.5, we need to keep track of each allocation's size ourselves. Of course doing this adds some memory overhead, especially when doing lots of small allocations, but I think it's better than nothing. The test suite runs fine on my OpenBSD -current machine when adding--fstdalloctocommonFlagsintest/Spec.hs.