[Git][ghc/ghc][master] 2 commits: rts: fix typo in TICK_ALLOC_RTS
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 5efb58dc by Cheng Shao at 2026-01-21T16:07:36-05:00 rts: fix typo in TICK_ALLOC_RTS This patch fixes a typo in the `TICK_ALLOC_RTS` macro, the original `bytes` argument was silently dropped. The Cmm code has its own version of `TICK_ALLOC_RTS` not affected by this typo, it affected the C RTS, and went unnoticed because the variable `n` happened to also be available at its call site. But the number was incorrect. Also fixes its call site since `WDS()` is not available in C. - - - - - c406ea69 by Cheng Shao at 2026-01-21T16:07:36-05:00 rts: remove broken & unused ALLOC_P_TICKY This patch removes the `ALLOC_P_TICKY` macro from the rts, it's unused, and its expanded code is already broken. - - - - - 3 changed files: - rts/include/Cmm.h - rts/include/stg/Ticky.h - rts/sm/Storage.c Changes: ===================================== rts/include/Cmm.h ===================================== @@ -441,12 +441,6 @@ #define HP_CHK_P(bytes, fun, arg) \ HEAP_CHECK(bytes, GC_PRIM_P(fun,arg)) -// TODO I'm not seeing where ALLOC_P_TICKY is used; can it be removed? -// -NSF March 2013 -#define ALLOC_P_TICKY(bytes, fun, arg) \ - HP_CHK_P(bytes); \ - TICK_ALLOC_RTS(bytes); - // Load a field out of structure with relaxed ordering. #define RELAXED_LOAD_FIELD(fld, ptr) \ REP_##fld![(ptr) + OFFSET_##fld] ===================================== rts/include/stg/Ticky.h ===================================== @@ -246,7 +246,7 @@ EXTERN StgInt RET_UNBOXED_TUP_hst[TICKY_BIN_COUNT] INIT({0}); TICK_BUMP_BY(ALLOC_THK_gds,g);\ TICK_BUMP_BY(ALLOC_THK_slp,s);\ -#define TICK_ALLOC_RTS(bytes)\ +#define TICK_ALLOC_RTS(n)\ TICK_BUMP(ALLOC_RTS_ctr);\ TICK_BUMP_BY(ALLOC_RTS_tot,n); #endif ===================================== rts/sm/Storage.c ===================================== @@ -990,7 +990,7 @@ move_STACK (StgStack *src, StgStack *dest) void accountAllocation(Capability *cap, W_ n) { - TICK_ALLOC_RTS(WDS(n)); + TICK_ALLOC_RTS(n*sizeof(W_)); CCS_ALLOC(cap->r.rCCCS,n); if (cap->r.rCurrentTSO != NULL) { // cap->r.rCurrentTSO->alloc_limit -= n*sizeof(W_) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/485c12b2fe697b71a62fcd1f418aaae... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/485c12b2fe697b71a62fcd1f418aaae... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)