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
{{ message }}
Repository navigation
Commit eb5c8c1
Browse filesBrowse the repository at this point in the historyBrowse files
mem: stop HG_MALLOC clobbering ROUNDTO for the other allocators
hg_malloc.h did "#undef ROUNDTO" and redefined it as sizeof(void *).
Since common.h includes hg_malloc.h last - after hp_malloc.h - that
definition won in every translation unit including common.h, silently
replacing HP_MALLOC's "ROUNDTO 8UL" inside hp_malloc.c itself.
On 64-bit sizeof(void *) is also 8, so the value was unchanged and
nothing showed. On 32-bit it becomes 4 and size_t is unsigned int, which
broke the build at mem/hp_malloc.o under -Werror=format ("%lu"/"%ld"
against ROUNDTO in hp_malloc.c and hp_malloc_dyn.h), and, more quietly,
changed HP_MALLOC's own geometry there: HP_LINEAR_HASH_SIZE and UN_HASH()
are derived from ROUNDTO, the block struct is aligned to it, and it is
persisted in the shm pattern file.
Give HG_MALLOC its own HG_ROUNDTO instead, the way q_malloc already uses
QM_ROUNDTO, and drop the #undef of the shared macro. No functional change
to HG_MALLOC: HG_ROUNDTO keeps the exact definition ROUNDTO had here.
0 commit comments