mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 03:07:29 +02:00
Support WOLFSSL_TRACK_MEMORY
with SINGLE_THREADED
.
This commit is contained in:
@ -177,7 +177,7 @@ static WC_INLINE void* TrackMalloc(size_t sz)
|
|||||||
(void)line;
|
(void)line;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if defined(DO_MEM_LIST) || defined(DO_MEM_STATS)
|
#if !defined(SINGLE_THREADED) && (defined(DO_MEM_LIST) || defined(DO_MEM_STATS))
|
||||||
if (pthread_mutex_lock(&memLock) == 0)
|
if (pthread_mutex_lock(&memLock) == 0)
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
@ -223,7 +223,7 @@ static WC_INLINE void* TrackMalloc(size_t sz)
|
|||||||
ourMemList.tail = header; /* add to the end either way */
|
ourMemList.tail = header; /* add to the end either way */
|
||||||
ourMemList.count++;
|
ourMemList.count++;
|
||||||
#endif
|
#endif
|
||||||
#if defined(DO_MEM_LIST) || defined(DO_MEM_STATS)
|
#if !defined(SINGLE_THREADED) && (defined(DO_MEM_LIST) || defined(DO_MEM_STATS))
|
||||||
pthread_mutex_unlock(&memLock);
|
pthread_mutex_unlock(&memLock);
|
||||||
}
|
}
|
||||||
#endif /* DO_MEM_LIST */
|
#endif /* DO_MEM_LIST */
|
||||||
@ -250,7 +250,7 @@ static WC_INLINE void TrackFree(void* ptr)
|
|||||||
header = &mt->u.hint;
|
header = &mt->u.hint;
|
||||||
sz = header->thisSize;
|
sz = header->thisSize;
|
||||||
|
|
||||||
#if defined(DO_MEM_LIST) || defined(DO_MEM_STATS)
|
#if !defined(SINGLE_THREADED) && (defined(DO_MEM_LIST) || defined(DO_MEM_STATS))
|
||||||
if (pthread_mutex_lock(&memLock) == 0)
|
if (pthread_mutex_lock(&memLock) == 0)
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
@ -284,7 +284,7 @@ static WC_INLINE void TrackFree(void* ptr)
|
|||||||
ourMemList.count--;
|
ourMemList.count--;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(DO_MEM_LIST) || defined(DO_MEM_STATS)
|
#if !defined(SINGLE_THREADED) && (defined(DO_MEM_LIST) || defined(DO_MEM_STATS))
|
||||||
pthread_mutex_unlock(&memLock);
|
pthread_mutex_unlock(&memLock);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user