qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 3/3] linux-user/syscall.c: do_ppoll: eliminate large alloc


From: Michael Tokarev
Subject: Re: [PATCH v3 3/3] linux-user/syscall.c: do_ppoll: eliminate large alloca
Date: Thu, 14 Sep 2023 14:05:21 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0

14.09.2023 11:26, Michael Tokarev wrote:
14.09.2023 11:18, Daniel P. Berrangé wrote:
..
-    struct pollfd *pfd = NULL;
+    struct pollfd *pfd = NULL, *heap_pfd = NULL;

g_autofree struct pollfd *heap_pdf = NULL;

...
  out:
+    g_free(heap_pfd);

This can be dropped with g_autofree usage

Yes, I know this, - this was deliberate choice.
Personally I'm just too used to old-school explicit resource deallocations.
Here, there's a single place where everything gets freed, so there's little
reason to use fancy modern automatic deallocations. To my taste anyway.
Maybe some future modifications adding some future ppoll3.. :)

Sure thing I can drop that and change it to autofree.

Should I? If that's easier in todays world :)

/mjt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]