summaryrefslogtreecommitdiff
path: root/malloc.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2005-06-02 07:19:43 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-06-03 08:31:26 +0000
commitb464bac0b70c4876af1296864220315edde8461d (patch)
tree9d2088559b19bbf0fbf64591f1dcd7df4961be5b /malloc.c
parent2d706fb2bbfd21eac5cd2efc341a42f1caed2490 (diff)
downloadperl-b464bac0b70c4876af1296864220315edde8461d.tar.gz
Random consting
Message-ID: <20050602171943.GA16553@petdance.com> p4raw-id: //depot/perl@24689
Diffstat (limited to 'malloc.c')
-rw-r--r--malloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/malloc.c b/malloc.c
index 05c0528e39..521248ab6d 100644
--- a/malloc.c
+++ b/malloc.c
@@ -1337,7 +1337,7 @@ fill_pat_4bytes(unsigned char *s, size_t nbytes, const unsigned char *fill)
{
unsigned char *e = s + nbytes;
long *lp;
- long lfill = *(long*)fill;
+ const long lfill = *(long*)fill;
if (PTR2UV(s) & (sizeof(long)-1)) { /* Align the pattern */
int shift = sizeof(long) - (PTR2UV(s) & (sizeof(long)-1));
@@ -1378,7 +1378,7 @@ cmp_pat_4bytes(unsigned char *s, size_t nbytes, const unsigned char *fill)
{
unsigned char *e = s + nbytes;
long *lp;
- long lfill = *(long*)fill;
+ const long lfill = *(long*)fill;
if (PTR2UV(s) & (sizeof(long)-1)) { /* Align the pattern */
int shift = sizeof(long) - (PTR2UV(s) & (sizeof(long)-1));
@@ -2357,12 +2357,12 @@ Perl_malloced_size(void *p)
{
union overhead *ovp = (union overhead *)
((caddr_t)p - sizeof (union overhead) * CHUNK_SHIFT);
- int bucket = OV_INDEX(ovp);
+ const int bucket = OV_INDEX(ovp);
#ifdef RCHECK
/* The caller wants to have a complete control over the chunk,
disable the memory checking inside the chunk. */
if (bucket <= MAX_SHORT_BUCKET) {
- MEM_SIZE size = BUCKET_SIZE_REAL(bucket);
+ const MEM_SIZE size = BUCKET_SIZE_REAL(bucket);
ovp->ov_size = size + M_OVERHEAD - 1;
*((u_int *)((caddr_t)ovp + size + M_OVERHEAD - RMAGIC_SZ)) = RMAGIC;
}