/** * * massimot: experimental code * * This method provides the same interface of the push one but uses the * multipush method to provide a batch of items to the consumer thus * ensuring better cache locality and lowering the cache trashing. * * \return TODO */ inline bool mpush(void * const data) { if (!data) return false; if (mcnt==MULTIPUSH_BUFFER_SIZE) return multipush(); multipush_buf[mcnt++]=data; if (mcnt==MULTIPUSH_BUFFER_SIZE) return multipush(); return true; }
/** * * massimot: experimental code * * This method provides the same interface of the push one but uses the * multipush method to provide a batch of items to the consumer thus * ensuring better cache locality and lowering the cache trashing. * * \return TODO */ inline bool mpush(void * const data) { assert(data != NULL); if (mcnt==MULTIPUSH_BUFFER_SIZE) return multipush(); multipush_buf[mcnt++]=data; if (mcnt==MULTIPUSH_BUFFER_SIZE) return multipush(); return true; }
/* REW -- ? */ inline bool flush() { return (mcnt ? multipush(multipush_buf,mcnt) : true); }
inline bool flush() { return (mcnt ? multipush() : true); }