Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: src/platform/vboot_reference/cgptlib/quick_sort.h

Issue 1701017: Add more test cases for GptInit() and fixed some bugs (Closed)
Patch Set: refine for code review Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5 #ifndef VBOOT_REFERENCE_QSORT_H_
6 #define VBOOT_REFERENCE_QSORT_H_
7
8 #define MAX_QUICK_SORT_ELEMENT_SIZE 512
9
10 /* QuickSort() is an in-place, and unstable quick sort implementation.
11 * Given a compare function, this function sorts elements for you.
12 * 'elements' points to the base of un-sorted array.
13 * 'number_of_elements' indicates the number of elements in array.
14 * 'size' indicates the size (in bytes) of an element unit.
15 * The 'compare_function' should return true if 'a' precedes 'b'.
16 *
17 * NOTE: For performance issue, we reserve a static buffer for swap.
18 * So that the 'size' cannot exceed the buffer size
19 * (MAX_QUICK_SORT_ELEMENT_SIZE). */
20 void QuickSort(void *elements, int number_of_elements, int size,
21 int (*compare_function)(const void *a, const void *b));
22
23 #endif /* VBOOT_REFERENCE_QSORT_H_ */
OLDNEW
« no previous file with comments | « src/platform/vboot_reference/cgptlib/gpt.h ('k') | src/platform/vboot_reference/cgptlib/quick_sort.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698