This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove code for supporting 80286 based systems.
authorNicholas Clark <nick@ccl4.org>
Fri, 27 Jul 2012 17:17:54 +0000 (19:17 +0200)
committerNicholas Clark <nick@ccl4.org>
Sat, 28 Jul 2012 14:27:54 +0000 (16:27 +0200)
The 80286 was released two years before Perl 1, but the support code was
added with Perl 3. The chip hasn't been produced for more than 15 years -
even the 80386 hasn't been manufactured since 2007. Most of the other
memory model code was removed by commit 5869b1f143426909 in Sep 2000, so
support for 16 bit systems is long dead.

handy.h
malloc.c
perl.h
x2p/a2p.h

diff --git a/handy.h b/handy.h
index e793039..c736120 100644 (file)
--- a/handy.h
+++ b/handy.h
 #ifdef NULL
 #undef NULL
 #endif
-#ifndef I286
 #  define NULL 0
-#else
-#  define NULL 0L
-#endif
 #endif
 
 #ifndef PERL_CORE
index 98efdb4..996fa66 100644 (file)
--- a/malloc.c
+++ b/malloc.c
 #define MIN_BUC_POW2 (sizeof(void*) > 4 ? 3 : 2) /* Allow for 4-byte arena. */
 #define MIN_BUCKET (MIN_BUC_POW2 * BUCKETS_PER_POW2)
 
-#if !(defined(I286))
-       /* take 2k unless the block is bigger than that */
-#  define LOG_OF_MIN_ARENA 11
-#else
-       /* take 16k unless the block is bigger than that 
-          (80286s like large segments!), probably good on the atari too */
-#  define LOG_OF_MIN_ARENA 14
-#endif
+#define LOG_OF_MIN_ARENA 11
 
 #if defined(DEBUGGING) && !defined(NO_RCHECK)
 #  define RCHECK
  */
 #define u_short unsigned short
 
-/* 286 likes big chunks, which gives too much overhead. */
-#if (defined(RCHECK) || defined(I286)) && defined(PACK_MALLOC)
+#if defined(RCHECK) && defined(PACK_MALLOC)
 #  undef PACK_MALLOC
 #endif 
 
@@ -1549,14 +1541,12 @@ getpages(MEM_SIZE needed, int *nblksp, int bucket)
        /* Second, check alignment. */
        slack = 0;
 
-#  ifndef I286         /* The sbrk(0) call on the I286 always returns the next segment */
        /* WANTED_ALIGNMENT may be more than NEEDED_ALIGNMENT, but this may
           improve performance of memory access. */
        if (PTR2UV(cp) & (WANTED_ALIGNMENT - 1)) { /* Not aligned. */
            slack = WANTED_ALIGNMENT - (PTR2UV(cp) & (WANTED_ALIGNMENT - 1));
            add += slack;
        }
-#  endif
                
        if (add) {
            DEBUG_m(PerlIO_printf(Perl_debug_log, 
@@ -1617,7 +1607,6 @@ getpages(MEM_SIZE needed, int *nblksp, int bucket)
            fatalcroak("Misalignment of sbrk()\n");
        else
 #  endif
-#ifndef I286   /* Again, this should always be ok on an 80286 */
        if (PTR2UV(ovp) & (MEM_ALIGNBYTES - 1)) {
            DEBUG_m(PerlIO_printf(Perl_debug_log, 
                                  "fixing sbrk(): %d bytes off machine alignment\n",
@@ -1630,7 +1619,6 @@ getpages(MEM_SIZE needed, int *nblksp, int bucket)
            sbrk_slack += (1 << (bucket >> BUCKET_POW2_SHIFT));
 # endif
        }
-#endif
        ;                               /* Finish "else" */
        sbrked_remains = require - needed;
        last_op = cp;
diff --git a/perl.h b/perl.h
index 83def76..614f280 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -3491,10 +3491,6 @@ struct ptr_tbl {
     struct ptr_tbl_ent         *tbl_arena_end;
 };
 
-#if defined(iAPX286) || defined(M_I286) || defined(I80286)
-#   define I286
-#endif
-
 #if defined(htonl) && !defined(HAS_HTONL)
 #define HAS_HTONL
 #endif
index 6083b79..bf31b3a 100644 (file)
--- a/x2p/a2p.h
+++ b/x2p/a2p.h
@@ -344,11 +344,7 @@ union u_ops {
     int ival;
     char *cval;
 };
-#if defined(iAPX286) || defined(M_I286) || defined(I80286)     /* 80286 hack */
-#define OPSMAX (64000/sizeof(union u_ops))     /* approx. max segment size */
-#else
 #define OPSMAX 50000
-#endif                                                 /* 80286 hack */
 EXT union u_ops ops[OPSMAX];
 
 typedef struct string STR;