Skip to content

Incorrect README compilation instructions #354

@tanksdude

Description

@tanksdude

I may be misinterpreting the instructions, but they don't seem to be correct. I tested on Windows MSVC and Linux GCC, compiled by simply adding rpmalloc.[h|c]. Most of what I did was reading the README and experimenting with compilation settings to find out what worked and what didn't.

1.4.5 and main branch:

(Not sure how useful this section is since 2.0.0 seems to be nearing completion.)

On Windows platforms and C++ overrides you have to #include <rpnew.h> in at least one source file ...

I think this is also required on non-Windows platforms, but only when ENABLE_OVERRIDE is not enabled. And there is no include guard in the file, so "at least one" should be "only one".

ENABLE_OVERRIDE

Windows and Linux both need ENABLE_PRELOAD also enabled. GCC needed _GNU_SOURCE due to #include <dlfcn.h> and RTLD_NEXT.

latest develop branch:

For C++ overrides you have to #include <rpnew.h> in at least one source file.

I think this is Windows-only. I could not get it to compile on Linux due to redefining malloc/free/new/delete, and malloc.c implies it's Windows-only due to the #ifdef _WIN32 section, not to mention the #define __CRTDECL in rpnew.h. And no include guard so "at least one" → "only one".

other issue on 1.4.5

Maybe this is just MSVC being weird, but I had a strange issue where _msize_base needed to be noexcept to compile. I changed that, like a day or two passed, then went to recompile and that was no longer needed. I don't believe I updated anything during that timeframe and I haven't been able to reproduce that compilation issue. Has anyone else encountered this? My searches showed it was supposedly a Windows SDK issue, but I definitely didn't update that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions