I can't figure out the meaning of the word "bump" in the following sentence:

Periodically, a full sweep is made — large objects are still not copied (they just get their generation count bumped), and blocks containing small objects are copied and compacted.

It seems that it means increasing the variable, but no dictionary contains such definition for this word. And even if it is increasing, what increasing exactly is it? Increment the variable (add one) or add some random positive number?

  • FWIW, this is semi-specific to "counters", and the etymology is that a "counter" used to be a mechanical device similar to an old auto odometer. There was a button or lever on it that would be "bumped" to increment or decrement the count. These counters were commonly used in early (punch-card era) data processing equipment. – Hot Licks Dec 21 '15 at 22:03

It means, as you guess, to increment the counter. See also the phrase bump up, which means "to raise". It's not stated how much the counter gets bumped but presumably that's not important or it's 1.

  • +1. In this case, the generation count is incremented, what results in a lower priority for the next garbage collection. Another example of "bump" use is: "The Minor version denotes public releases. Each time a version has been released this number is bumped". – Graffito Dec 21 '15 at 20:10

The phrase used in the example is to bump a count and not to bump a counter. It's not a stock phrase but is an idiomatic use of count in the sense of tally and bump in the sense of increase or nudge forward.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.