summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-11-21 22:25:14 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-11-21 22:25:14 +0000
commit84d4ea48280f6b54fdc70fe4c8b9494e3331071e (patch)
tree67eb1ba8c72d793358608e97b8bcb9aa431b1d71 /perl.h
parentc85707204c5d2a93ef021c88e43a92ba2d602304 (diff)
downloadperl-84d4ea48280f6b54fdc70fe4c8b9494e3331071e.tar.gz
Implement the sort pragma. Split sort code from pp_ctl.c
to pp_sort.c. Includes the quicksort stabilizing layer from John P. Linderman. -Msort=qsort or -Msort=fast is faster than without (or with -Msort=mergesort or -Msort=safe) for short random inputs, but for some reason not quite as fast as 5.6.1 qsort. More benchmarking, profiling, tuning, and optimizing definitely needed. p4raw-id: //depot/perl@13179
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/perl.h b/perl.h
index e0250aec41..a1bb275862 100644
--- a/perl.h
+++ b/perl.h
@@ -3100,6 +3100,14 @@ enum { /* pass one of these to get_vtbl */
#define HINT_FILETEST_ACCESS 0x00400000
#define HINT_UTF8 0x00800000
+#define HINT_SORT_SORT_BITS 0x000000FF /* allow 256 different ones */
+#define HINT_SORT_QUICKSORT 0x00000001
+#define HINT_SORT_MERGESORT 0x00000002
+#define HINT_SORT_STABLE 0x00000100 /* sort styles */
+#define HINT_SORT_INSENSITIVE 0x00000200
+#define HINT_SORT_SAFE 0x00000300 /* stable and insensitive */
+#define HINT_SORT_FAST 0x00000400 /* damn the icebergs */
+
/* Various states of the input record separator SV (rs) */
#define RsSNARF(sv) (! SvOK(sv))
#define RsSIMPLE(sv) (SvOK(sv) && (! SvPOK(sv) || SvCUR(sv)))