]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
avoid duplicate code comments
authorYann Collet <cyan@fb.com>
Thu, 14 Jun 2018 23:47:05 +0000 (19:47 -0400)
committerYann Collet <cyan@fb.com>
Thu, 14 Jun 2018 23:47:05 +0000 (19:47 -0400)
when a function is decribed in hist.h,
do not describe it again in hist.c
to avoid future doc synchronization issues.

lib/compress/hist.c
lib/compress/hist.h

index da3b749db9bf995e8d59d79a20bc278da3068c53..16524756b8dc987f92883c1c1c560efa513e41f6 100644 (file)
@@ -46,14 +46,6 @@ unsigned HIST_isError(size_t code) { return ERR_isError(code); }
 /*-**************************************************************
  *  Histogram functions
  ****************************************************************/
-/*! HIST_count_simple :
-    Counts byte values within `src`, storing histogram into table `count`.
-    Doesn't use any additional memory, very limited stack usage.
-    But unsafe : doesn't check that all values within `src` fit into `count`.
-    For this reason, prefer using a table `count` of size 256.
-    @return : count of most numerous element.
-              this function doesn't produce any error (i.e. it must succeed).
-*/
 unsigned HIST_count_simple(unsigned* count, unsigned* maxSymbolValuePtr,
                            const void* src, size_t srcSize)
 {
@@ -83,7 +75,10 @@ unsigned HIST_count_simple(unsigned* count, unsigned* maxSymbolValuePtr,
 
 
 /* HIST_count_parallel_wksp() :
- * Same as HIST_count_parallel(), but using an externally provided scratch buffer.
+ * store histogram into 4 intermediate tables, recombined at the end.
+ * this design makes better use of OoO cpus,
+ * and is noticeably faster when some values are heavily repeated.
+ * But it needs some additional workspace for intermediate tables.
  * `workSpace` size must be a table of size >= HIST_WKSP_SIZE_U32.
  * @return : largest histogram frequency,
  *           or an error code (notably when histogram would be larger than *maxSymbolValuePtr). */
index 293b188bc86eb8cbeb178733d0fe8d097ef917f4..788470da7f732c53f6bfe1a361b4224d73a780fa 100644 (file)
@@ -81,10 +81,12 @@ size_t HIST_countFast_wksp(unsigned* count, unsigned* maxSymbolValuePtr,
                            unsigned* workSpace);
 
 /*! HIST_count_simple() :
- *  Same as HIST_countFast(), but does not use any additional memory (not even on stack).
- *  This function is unsafe, and will segfault if any value within `src` is `> *maxSymbolValuePtr`.
+ *  Same as HIST_countFast(), this function is unsafe,
+ *  and will segfault if any value within `src` is `> *maxSymbolValuePtr`.
  *  It is also a bit slower for large inputs.
- *  This function doesn't produce any error (i.e. it must succeed).
+ *  However, it does not need any additional memory (not even on stack).
+ * @return : count of the most frequent symbol.
+ *  Note this function doesn't produce any error (i.e. it must succeed).
  */
 unsigned HIST_count_simple(unsigned* count, unsigned* maxSymbolValuePtr,
                            const void* src, size_t srcSize);