Skip to content

Commit

Permalink
lib min_heap: add brief introduction to Min Heap API
Browse files Browse the repository at this point in the history
A short description of the Min Heap API is added to the min_heap.h,
explaining its purpose for managing min-heaps and emphasizing the use of
macro wrappers instead of direct function calls.  For more details, users
are directed to the documentation at Documentation/core-api/min_heap.rst.

Link: https://lkml.kernel.org/r/20241129181222.646855-4-visitorckw@gmail.com
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Cc: Ching-Chun (Jim) Huang <jserv@ccns.ncku.edu.tw>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Kuan-Wei Chiu authored and Andrew Morton committed Jan 13, 2025
1 parent 93aa1b5 commit 2ad0546
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions include/linux/min_heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
#include <linux/string.h>
#include <linux/types.h>

/*
* The Min Heap API provides utilities for managing min-heaps, a binary tree
* structure where each node's value is less than or equal to its children's
* values, ensuring the smallest element is at the root.
*
* Users should avoid directly calling functions prefixed with __min_heap_*().
* Instead, use the provided macro wrappers.
*
* For further details and examples, refer to Documentation/core-api/min_heap.rst.
*/

/**
* Data structure to hold a min-heap.
* @nr: Number of elements currently in the heap.
Expand Down

0 comments on commit 2ad0546

Please sign in to comment.