[glib: 2/8] slice-test: Use new g_newa0() function
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 2/8] slice-test: Use new g_newa0() function
- Date: Fri, 26 Nov 2021 12:38:47 +0000 (UTC)
commit 1c7936b368aa8745a20cf016086b635d7a1efe9b
Author: Nishal Kulkarni <nishalkulkarni gmail com>
Date: Thu Nov 25 13:42:39 2021 +0530
slice-test: Use new g_newa0() function
Replace old `g_alloca()` and `memset()` with `g_newa0()`
tests/slice-test.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/tests/slice-test.c b/tests/slice-test.c
index 055adba5c..4b1b5f710 100644
--- a/tests/slice-test.c
+++ b/tests/slice-test.c
@@ -95,8 +95,7 @@ test_memchunk_thread (gpointer data)
}
/* prepare for memchunk creation */
- memchunks = g_alloca (sizeof (memchunks[0]) * prime_size);
- memset (memchunks, 0, sizeof (memchunks[0]) * prime_size);
+ memchunks = g_newa0 (GMemChunk*, prime_size);
ps = g_new (guint8*, number_of_blocks);
ss = g_new (guint, number_of_blocks);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]