You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/08/26 19:57:33 UTC
svn commit: r808141 - in
/commons/sandbox/runtime/trunk/src/main/native/include/arch:
unix/acr_arch.h windows/acr_arch.h
Author: mturk
Date: Wed Aug 26 17:57:32 2009
New Revision: 808141
URL: http://svn.apache.org/viewvc?rev=808141&view=rev
Log:
Use malloc for x_malloc not calloc
Modified:
commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h
commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h
Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h?rev=808141&r1=808140&r2=808141&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h Wed Aug 26 17:57:32 2009
@@ -79,7 +79,7 @@
static ACR_INLINE void *x_malloc(size_t size)
{
if (size > 0 && size < INT_MAX)
- return calloc(1, size);
+ return malloc(size);
else {
errno = ENOMEM;
return NULL;
@@ -104,12 +104,12 @@
static ACR_FORCEINLINE void *x_memzero(void *p, size_t len)
{
volatile char *ptr = (volatile char *)p;
-
+
while (len) {
*ptr = 0;
ptr++;
len--;
- }
+ }
return p;
}
@@ -120,7 +120,7 @@
* @return buffer with the content of the file. Use free() to
* deallocate the buffer when done.
* If the file cannot be read, function returns NULL.
- */
+ */
char *ACR_FileReadTxt(const char *name);
Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h?rev=808141&r1=808140&r2=808141&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h Wed Aug 26 17:57:32 2009
@@ -328,7 +328,7 @@
static ACR_INLINE void *x_malloc(size_t size)
{
if (size > 0 && size < INT_MAX)
- return calloc(1, size);
+ return malloc(size);
else {
errno = ENOMEM;
return NULL;