summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2007-03-27 18:07:52 +0300
committerH.Merijn Brand <h.m.brand@xs4all.nl>2007-03-27 12:30:11 +0000
commit19a94d75aea23d860dc398284bf0810d3e2bbfa2 (patch)
treeabd158e3b58402c2c78f68aea12fb4a6ca4e40cb /util.c
parentd3df0cfdbd533cd6ac647744531e0fed3b26c653 (diff)
downloadperl-19a94d75aea23d860dc398284bf0810d3e2bbfa2.tar.gz
stop the cargo cult of (MEM_SIZE)~0
Message-Id: <200703271207.l2RC7qOC443040@kosh.hut.fi> p4raw-id: //depot/perl@30774
Diffstat (limited to 'util.c')
-rw-r--r--util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util.c b/util.c
index 8205aa884e..f670bb8baa 100644
--- a/util.c
+++ b/util.c
@@ -261,12 +261,12 @@ Perl_safesyscalloc(MEM_SIZE count, MEM_SIZE size)
MEM_SIZE total_size = 0;
/* Even though calloc() for zero bytes is strange, be robust. */
- if (size && (count <= (MEM_SIZE)~0 / size))
+ if (size && (count <= MEM_SIZE_MAX / size))
total_size = size * count;
else
Perl_croak_nocontext(PL_memory_wrap);
#ifdef PERL_TRACK_MEMPOOL
- if (sTHX <= (MEM_SIZE)~0 - (MEM_SIZE)total_size)
+ if (sTHX <= MEM_SIZE_MAX - (MEM_SIZE)total_size)
total_size += sTHX;
else
Perl_croak_nocontext(PL_memory_wrap);