Update contrib.
1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 // We use the EPOC32 memory allocation which is already
20 // thread-safe, so we don't need the _malloc_r variants
24 EXPORT_C void* malloc (size_t nbytes)
26 return User::Alloc(nbytes);
29 EXPORT_C void* realloc (void *p, size_t nbytes)
31 return User::ReAlloc(p, nbytes);
34 EXPORT_C void free (void *p)
40 EXPORT_C void* _placeholder_memmove (void* to, const void* from, size_t len)
42 EXPORT_C void* memmove (void* to, const void* from, size_t len)
45 Mem::Copy(to, from, len); // E32 unaligned careful copy
50 EXPORT_C void* _placeholder_memset (void* to, int c, size_t len)
52 EXPORT_C void* memset (void* to, int c, size_t len)
59 EXPORT_C void* calloc (size_t n, size_t size)
62 void *ret = User::Alloc(n);
69 EXPORT_C size_t strlen (const char *str)
71 return User::StringLength((TUint8*)str);
74 EXPORT_C size_t wcslen (const wchar_t *str)
76 return User::StringLength((TUint16*)str);
79 EXPORT_C unsigned int sleep (unsigned int secs)
81 // we don't allow the possibility of being woken by signals
82 User::After(secs*1000000);