Any reason for dropping functions from guarded pools? Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
User avatar
FXCoder
Posts: 384
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 180 times
Been thanked: 130 times

Any reason for dropping functions from guarded pools?  Topic is solved

Postby FXCoder » Mon Mar 11, 2019 6:35 am

Were these dropped for any reason from chmempools.h when os/lib became os/oslib?

Code: Select all


/**
 * @brief   Gets the count of objects in a guarded memory pool.
 * @pre     The guarded memory pool must be already been initialized.
 *
 * @param[in] gmp       pointer to a @p guarded_memory_pool_t structure
 *
 * @iclass
 */
static inline cnt_t chGuardedPoolGetCounterI(guarded_memory_pool_t *gmp) {

  return chSemGetCounterI(&gmp->sem);
}

/**
 * @brief   Resets the guarded memory pool.
 * @pre     The guarded memory pool must be already been initialized.
 * @post    Any threads waiting on the pool receive the MSG_RESET.
 * @post    The pool counter is set to the supplied value.
 *
 * @param[in] gmp       pointer to a @p guarded_memory_pool_t structure
 * @param[in] n         the new value of the pool counter. The value must
 *                      be non-negative.
 * @iclass
 */
static inline void chGuardedPoolResetI(guarded_memory_pool_t *gmp, cnt_t n) {

  chSemResetI(&gmp->sem, n);
}

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Any reason for dropping functions from guarded pools?

Postby Giovanni » Mon Mar 11, 2019 6:44 am

The reset function is simply wrong but the get counter looks OK, probably a mistake on my side, I don't remember removing it. I will reintroduce it.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Any reason for dropping functions from guarded pools?

Postby Giovanni » Mon Mar 11, 2019 12:49 pm

I re-added the get counter to trunk and 19.1.x.

Giovanni

User avatar
FXCoder
Posts: 384
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 180 times
Been thanked: 130 times

Re: Any reason for dropping functions from guarded pools?

Postby FXCoder » Mon Mar 11, 2019 2:14 pm

Thanks.
I was using the get counter in an assert to check if all pool members were released prior to destroying the pool.
I’ll resurrect that assert now.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 22 guests