You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by st...@apache.org on 2002/08/13 00:02:18 UTC
cvs commit: apr/memory/unix apr_pools.c
striker 2002/08/12 15:02:18
Modified: memory/unix apr_pools.c
Log:
Fix pools to play nice with gcc bounds checking.
Submitted by: Blair Zajac <bl...@orcaware.com>
Revision Changes Path
1.184 +5 -9 apr/memory/unix/apr_pools.c
Index: apr_pools.c
===================================================================
RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v
retrieving revision 1.183
retrieving revision 1.184
diff -u -r1.183 -r1.184
--- apr_pools.c 13 Jul 2002 21:38:02 -0000 1.183
+++ apr_pools.c 12 Aug 2002 22:02:18 -0000 1.184
@@ -606,24 +606,21 @@
{
apr_memnode_t *active, *node;
void *mem;
- char *endp;
apr_uint32_t free_index;
size = APR_ALIGN_DEFAULT(size);
active = pool->active;
/* If the active node has enough bytes left, use it. */
- endp = active->first_avail + size;
- if (endp < active->endp) {
+ if (size < active->endp - active->first_avail) {
mem = active->first_avail;
- active->first_avail = endp;
+ active->first_avail += size;
return mem;
}
node = active->next;
- endp = node->first_avail + size;
- if (endp < node->endp) {
+ if (size < node->endp - node->first_avail) {
*node->ref = node->next;
node->next->ref = node->ref;
}
@@ -634,13 +631,12 @@
return NULL;
}
- endp = node->first_avail + size;
}
node->free_index = 0;
mem = node->first_avail;
- node->first_avail = endp;
+ node->first_avail += size;
node->ref = active->ref;
*node->ref = node;
@@ -929,7 +925,7 @@
size = APR_PSPRINTF_MIN_STRINGSIZE;
node = active->next;
- if (!ps->got_a_new_node && node->first_avail + size < node->endp) {
+ if (!ps->got_a_new_node && size < node->endp - node->first_avail) {
*node->ref = node->next;
node->next->ref = node->ref;
Re: cvs commit: apr/memory/unix apr_pools.c
Posted by Branko Čibej <br...@xbc.nu>.
striker@apache.org wrote:
>striker 2002/08/12 15:02:18
>
> Modified: memory/unix apr_pools.c
> Log:
> Fix pools to play nice with gcc bounds checking.
>
> Submitted by: Blair Zajac <bl...@orcaware.com>
>
> Revision Changes Path
> 1.184 +5 -9 apr/memory/unix/apr_pools.c
>
This commit adds three warnings to the Windows compile:
apr\memory\unix\apr_pools.c(615) : warning C4018: '<' : signed/unsigned mismatch
apr\memory\unix\apr_pools.c(623) : warning C4018: '<' : signed/unsigned mismatch
apr\memory\unix\apr_pools.c(928) : warning C4018: '<' : signed/unsigned mismatch
--
Brane Čibej <br...@xbc.nu> http://www.xbc.nu/brane/
Re: cvs commit: apr/memory/unix apr_pools.c
Posted by Branko Čibej <br...@xbc.nu>.
striker@apache.org wrote:
>striker 2002/08/12 15:02:18
>
> Modified: memory/unix apr_pools.c
> Log:
> Fix pools to play nice with gcc bounds checking.
>
> Submitted by: Blair Zajac <bl...@orcaware.com>
>
> Revision Changes Path
> 1.184 +5 -9 apr/memory/unix/apr_pools.c
>
This commit adds three warnings to the Windows compile:
apr\memory\unix\apr_pools.c(615) : warning C4018: '<' : signed/unsigned mismatch
apr\memory\unix\apr_pools.c(623) : warning C4018: '<' : signed/unsigned mismatch
apr\memory\unix\apr_pools.c(928) : warning C4018: '<' : signed/unsigned mismatch
--
Brane Čibej <br...@xbc.nu> http://www.xbc.nu/brane/