FreeFile(file);
/* Sort the blocks to be loaded. */
- pg_qsort(blkinfo, num_elements, sizeof(BlockInfoRecord),
- apw_compare_blockinfo);
+ qsort(blkinfo, num_elements, sizeof(BlockInfoRecord),
+ apw_compare_blockinfo);
/* Populate shared memory state. */
apw_state->block_info_handle = dsm_segment_handle(seg);
* Sort the distances in descending order, so that the longest gaps are at
* the front.
*/
- pg_qsort(distances, ndistances, sizeof(DistanceValue), compare_distances);
+ qsort(distances, ndistances, sizeof(DistanceValue), compare_distances);
return distances;
}
j++;
}
- pg_qsort(candidates, numRels, sizeof(SelfJoinCandidate),
- self_join_candidates_cmp);
+ qsort(candidates, numRels, sizeof(SelfJoinCandidate),
+ self_join_candidates_cmp);
/*
* Iteratively form a group of relation indexes with the same oid and
/* sort the list of rlocators if necessary */
if (use_bsearch)
- pg_qsort(locators, n, sizeof(RelFileLocator), rlocator_comparator);
+ qsort(locators, n, sizeof(RelFileLocator), rlocator_comparator);
for (i = 0; i < NBuffers; i++)
{
/* sort the list of SMgrRelations if necessary */
if (use_bsearch)
- pg_qsort(srels, nrels, sizeof(SMgrSortArray), rlocator_comparator);
+ qsort(srels, nrels, sizeof(SMgrSortArray), rlocator_comparator);
for (i = 0; i < NBuffers; i++)
{
Assert(SysCacheSupportingRelOidSize <= lengthof(SysCacheSupportingRelOid));
/* Sort and de-dup OID arrays, so we can use binary search. */
- pg_qsort(SysCacheRelationOid, SysCacheRelationOidSize,
- sizeof(Oid), oid_compare);
+ qsort(SysCacheRelationOid, SysCacheRelationOidSize,
+ sizeof(Oid), oid_compare);
SysCacheRelationOidSize =
qunique(SysCacheRelationOid, SysCacheRelationOidSize, sizeof(Oid),
oid_compare);
- pg_qsort(SysCacheSupportingRelOid, SysCacheSupportingRelOidSize,
- sizeof(Oid), oid_compare);
+ qsort(SysCacheSupportingRelOid, SysCacheSupportingRelOidSize,
+ sizeof(Oid), oid_compare);
SysCacheSupportingRelOidSize =
qunique(SysCacheSupportingRelOid, SysCacheSupportingRelOidSize,
sizeof(Oid), oid_compare);
/*
- * OID comparator for pg_qsort
+ * OID comparator for qsort
*/
static int
oid_compare(const void *a, const void *b)
extern bool pg_get_user_home_dir(uid_t user_id, char *buffer, size_t buflen);
#endif
+/*
+ * Callers should use the qsort() macro defined below instead of calling
+ * pg_qsort() directly.
+ */
extern void pg_qsort(void *base, size_t nel, size_t elsize,
int (*cmp) (const void *, const void *));
extern int pg_qsort_strcmp(const void *a, const void *b);