Remove HAS_64K_LIMIT
authorBrian Fraser <fraserbn@gmail.com>
Fri, 30 Aug 2013 23:25:12 +0000 (20:25 -0300)
committerBrian Fraser <fraserbn@gmail.com>
Sat, 21 Sep 2013 11:47:39 +0000 (08:47 -0300)
This was only defined for MSDOS if not using DJGPP.  We've long
since dropped support for that, so this define and related code
can go.

dosish.h
malloc.c
sv.c
util.c

index 8c3917b..8b34369 100644 (file)
--- a/dosish.h
+++ b/dosish.h
 #endif
 #define dXSUB_SYS
 
-/*
- * 5.003_07 and earlier keyed on #ifdef MSDOS for determining if we were 
- * running on DOS, *and* if we had to cope with 16 bit memory addressing 
- * constraints, *and* we need to have memory allocated as unsigned long.
- *
- * with the advent of *real* compilers for DOS, they are not locked together.
- * MSDOS means "I am running on MSDOS". HAS_64K_LIMIT means "I have 
- * 16 bit memory addressing constraints".
- *
- * if you need the last, try #DEFINE MEM_SIZE unsigned long.
- */
-#ifdef MSDOS
-#  ifndef DJGPP
-#    define HAS_64K_LIMIT
-#  endif
-#endif
-
 /* USEMYBINMODE
  *     This symbol, if defined, indicates that the program should
  *     use the routine my_binmode(FILE *fp, char iotype, int mode) to insure
index a0a762e..79a8c89 100644 (file)
--- a/malloc.c
+++ b/malloc.c
@@ -755,16 +755,7 @@ static const char bucket_of[] =
 #  define POW2_OPTIMIZE_SURPLUS(bucket) 0
 #endif /* !TWO_POT_OPTIMIZE */
 
-#ifdef HAS_64K_LIMIT
-#  define BARK_64K_LIMIT(what,nbytes,size)                             \
-       if (nbytes > 0xffff) {                                          \
-               PerlIO_printf(PerlIO_stderr(),                          \
-                             "%s too large: %lx\n", what, size);       \
-               my_exit(1);                                             \
-       }
-#else /* !HAS_64K_LIMIT */
-#  define BARK_64K_LIMIT(what,nbytes,size)
-#endif /* !HAS_64K_LIMIT */
+#define BARK_64K_LIMIT(what,nbytes,size)
 
 #ifndef MIN_SBRK
 #  define MIN_SBRK 2048
diff --git a/sv.c b/sv.c
index 41f9d17..f32ac81 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -1479,13 +1479,6 @@ Perl_sv_grow(pTHX_ SV *const sv, STRLEN newlen)
 
     PERL_ARGS_ASSERT_SV_GROW;
 
-#ifdef HAS_64K_LIMIT
-    if (newlen >= 0x10000) {
-       PerlIO_printf(Perl_debug_log,
-                     "Allocation too large: %"UVxf"\n", (UV)newlen);
-       my_exit(1);
-    }
-#endif /* HAS_64K_LIMIT */
     if (SvROK(sv))
        sv_unref(sv);
     if (SvTYPE(sv) < SVt_PV) {
@@ -1497,10 +1490,6 @@ Perl_sv_grow(pTHX_ SV *const sv, STRLEN newlen)
        s = SvPVX_mutable(sv);
        if (newlen > SvLEN(sv))
            newlen += 10 * (newlen - SvCUR(sv)); /* avoid copy each time */
-#ifdef HAS_64K_LIMIT
-       if (newlen >= 0x10000)
-           newlen = 0xFFFF;
-#endif
     }
     else
     {
diff --git a/util.c b/util.c
index 6227474..6a499f1 100644 (file)
--- a/util.c
+++ b/util.c
@@ -76,13 +76,6 @@ Perl_safesysmalloc(MEM_SIZE size)
     dTHX;
 #endif
     Malloc_t ptr;
-#ifdef HAS_64K_LIMIT
-       if (size > 0xffff) {
-           PerlIO_printf(Perl_error_log,
-                         "Allocation too large: %lx\n", size) FLUSH;
-           my_exit(1);
-       }
-#endif /* HAS_64K_LIMIT */
 #ifdef PERL_TRACK_MEMPOOL
     size += sTHX;
 #endif
@@ -143,13 +136,6 @@ Perl_safesysrealloc(Malloc_t where,MEM_SIZE size)
     Malloc_t PerlMem_realloc();
 #endif /* !defined(STANDARD_C) && !defined(HAS_REALLOC_PROTOTYPE) */
 
-#ifdef HAS_64K_LIMIT
-    if (size > 0xffff) {
-       PerlIO_printf(Perl_error_log,
-                     "Reallocation too large: %lx\n", size) FLUSH;
-       my_exit(1);
-    }
-#endif /* HAS_64K_LIMIT */
     if (!size) {
        safesysfree(where);
        return NULL;
@@ -289,13 +275,13 @@ Perl_safesyscalloc(MEM_SIZE count, MEM_SIZE size)
     dTHX;
 #endif
     Malloc_t ptr;
-#if defined(PERL_TRACK_MEMPOOL) || defined(HAS_64K_LIMIT) || defined(DEBUGGING)
+#if defined(PERL_TRACK_MEMPOOL) || defined(DEBUGGING)
     MEM_SIZE total_size = 0;
 #endif
 
     /* Even though calloc() for zero bytes is strange, be robust. */
     if (size && (count <= MEM_SIZE_MAX / size)) {
-#if defined(PERL_TRACK_MEMPOOL) || defined(HAS_64K_LIMIT) || defined(DEBUGGING)
+#if defined(PERL_TRACK_MEMPOOL) || defined(DEBUGGING)
        total_size = size * count;
 #endif
     }
@@ -307,13 +293,6 @@ Perl_safesyscalloc(MEM_SIZE count, MEM_SIZE size)
     else
        croak_memory_wrap();
 #endif
-#ifdef HAS_64K_LIMIT
-    if (total_size > 0xffff) {
-       PerlIO_printf(Perl_error_log,
-                     "Allocation too large: %lx\n", total_size) FLUSH;
-       my_exit(1);
-    }
-#endif /* HAS_64K_LIMIT */
 #ifdef DEBUGGING
     if ((SSize_t)size < 0 || (SSize_t)count < 0)
        Perl_croak_nocontext("panic: calloc, size=%"UVuf", count=%"UVuf,