public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] posix: Remove alloca_account usage on getaddrinfo
@ 2022-03-16 18:00 Adhemerval Zanella
  0 siblings, 0 replies; 4+ messages in thread
From: Adhemerval Zanella @ 2022-03-16 18:00 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=41ca2b14515a2808e6a7f80a464abc0f0a222d9b

commit 41ca2b14515a2808e6a7f80a464abc0f0a222d9b
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 9 18:31:30 2022 -0300

    posix: Remove alloca_account usage on getaddrinfo

Diff:
---
 sysdeps/posix/getaddrinfo.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 13372e8d47..f22c36a262 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -336,10 +336,6 @@ gaih_inet (const char *name, const struct gaih_service *service,
   const char *canon = NULL;
   const char *orig_name = name;
 
-  /* Reserve stack memory for the scratch buffer in the getaddrinfo
-     function.  */
-  size_t alloca_used = sizeof (struct scratch_buffer);
-
   if (req->ai_protocol || req->ai_socktype)
     {
       ++tp;
@@ -371,7 +367,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	  if (tp->name[0])
 	    {
 	      st = (struct gaih_servtuple *)
-		alloca_account (sizeof (struct gaih_servtuple), alloca_used);
+		alloca (sizeof (struct gaih_servtuple));
 
 	      int rc = gaih_inet_serv (service->name, tp, req, st, tmpbuf);
 	      if (__glibc_unlikely (rc != 0))
@@ -396,8 +392,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		    continue;
 
 		  newp = (struct gaih_servtuple *)
-		    alloca_account (sizeof (struct gaih_servtuple),
-				    alloca_used);
+		    alloca (sizeof (struct gaih_servtuple));
 
 		  if (gaih_inet_serv (service->name,
 				      tp, req, newp, tmpbuf) != 0)
@@ -422,7 +417,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 
       if (req->ai_socktype || req->ai_protocol)
 	{
-	  st = alloca_account (sizeof (struct gaih_servtuple), alloca_used);
+	  st = alloca (sizeof (struct gaih_servtuple));
 	  st->next = NULL;
 	  st->socktype = tp->socktype;
 	  st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY)
@@ -439,8 +434,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	      {
 		struct gaih_servtuple *newp;
 
-		newp = alloca_account (sizeof (struct gaih_servtuple),
-				       alloca_used);
+		newp = alloca (sizeof (struct gaih_servtuple));
 		newp->next = NULL;
 		newp->socktype = tp->socktype;
 		newp->protocol = tp->protocol;
@@ -459,7 +453,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 
   if (name != NULL)
     {
-      at = alloca_account (sizeof (struct gaih_addrtuple), alloca_used);
+      at = alloca (sizeof (struct gaih_addrtuple));
       at->family = AF_UNSPEC;
       at->scopeid = 0;
       at->next = NULL;
@@ -940,7 +934,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
   else
     {
       struct gaih_addrtuple *atr;
-      atr = at = alloca_account (sizeof (struct gaih_addrtuple), alloca_used);
+      atr = at = alloca (sizeof (struct gaih_addrtuple));
       memset (at, '\0', sizeof (struct gaih_addrtuple));
 
       if (req->ai_family == AF_UNSPEC)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [glibc/azanella/clang] posix: Remove alloca_account usage on getaddrinfo
@ 2022-03-15 18:38 Adhemerval Zanella
  0 siblings, 0 replies; 4+ messages in thread
From: Adhemerval Zanella @ 2022-03-15 18:38 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=41ca2b14515a2808e6a7f80a464abc0f0a222d9b

commit 41ca2b14515a2808e6a7f80a464abc0f0a222d9b
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 9 18:31:30 2022 -0300

    posix: Remove alloca_account usage on getaddrinfo

Diff:
---
 sysdeps/posix/getaddrinfo.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 13372e8d47..f22c36a262 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -336,10 +336,6 @@ gaih_inet (const char *name, const struct gaih_service *service,
   const char *canon = NULL;
   const char *orig_name = name;
 
-  /* Reserve stack memory for the scratch buffer in the getaddrinfo
-     function.  */
-  size_t alloca_used = sizeof (struct scratch_buffer);
-
   if (req->ai_protocol || req->ai_socktype)
     {
       ++tp;
@@ -371,7 +367,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	  if (tp->name[0])
 	    {
 	      st = (struct gaih_servtuple *)
-		alloca_account (sizeof (struct gaih_servtuple), alloca_used);
+		alloca (sizeof (struct gaih_servtuple));
 
 	      int rc = gaih_inet_serv (service->name, tp, req, st, tmpbuf);
 	      if (__glibc_unlikely (rc != 0))
@@ -396,8 +392,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		    continue;
 
 		  newp = (struct gaih_servtuple *)
-		    alloca_account (sizeof (struct gaih_servtuple),
-				    alloca_used);
+		    alloca (sizeof (struct gaih_servtuple));
 
 		  if (gaih_inet_serv (service->name,
 				      tp, req, newp, tmpbuf) != 0)
@@ -422,7 +417,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 
       if (req->ai_socktype || req->ai_protocol)
 	{
-	  st = alloca_account (sizeof (struct gaih_servtuple), alloca_used);
+	  st = alloca (sizeof (struct gaih_servtuple));
 	  st->next = NULL;
 	  st->socktype = tp->socktype;
 	  st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY)
@@ -439,8 +434,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	      {
 		struct gaih_servtuple *newp;
 
-		newp = alloca_account (sizeof (struct gaih_servtuple),
-				       alloca_used);
+		newp = alloca (sizeof (struct gaih_servtuple));
 		newp->next = NULL;
 		newp->socktype = tp->socktype;
 		newp->protocol = tp->protocol;
@@ -459,7 +453,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 
   if (name != NULL)
     {
-      at = alloca_account (sizeof (struct gaih_addrtuple), alloca_used);
+      at = alloca (sizeof (struct gaih_addrtuple));
       at->family = AF_UNSPEC;
       at->scopeid = 0;
       at->next = NULL;
@@ -940,7 +934,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
   else
     {
       struct gaih_addrtuple *atr;
-      atr = at = alloca_account (sizeof (struct gaih_addrtuple), alloca_used);
+      atr = at = alloca (sizeof (struct gaih_addrtuple));
       memset (at, '\0', sizeof (struct gaih_addrtuple));
 
       if (req->ai_family == AF_UNSPEC)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [glibc/azanella/clang] posix: Remove alloca_account usage on getaddrinfo
@ 2022-03-11 17:22 Adhemerval Zanella
  0 siblings, 0 replies; 4+ messages in thread
From: Adhemerval Zanella @ 2022-03-11 17:22 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6329b007d5cabe897a2153d465f9269b98b26288

commit 6329b007d5cabe897a2153d465f9269b98b26288
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 9 18:31:30 2022 -0300

    posix: Remove alloca_account usage on getaddrinfo

Diff:
---
 sysdeps/posix/getaddrinfo.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 13372e8d47..f22c36a262 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -336,10 +336,6 @@ gaih_inet (const char *name, const struct gaih_service *service,
   const char *canon = NULL;
   const char *orig_name = name;
 
-  /* Reserve stack memory for the scratch buffer in the getaddrinfo
-     function.  */
-  size_t alloca_used = sizeof (struct scratch_buffer);
-
   if (req->ai_protocol || req->ai_socktype)
     {
       ++tp;
@@ -371,7 +367,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	  if (tp->name[0])
 	    {
 	      st = (struct gaih_servtuple *)
-		alloca_account (sizeof (struct gaih_servtuple), alloca_used);
+		alloca (sizeof (struct gaih_servtuple));
 
 	      int rc = gaih_inet_serv (service->name, tp, req, st, tmpbuf);
 	      if (__glibc_unlikely (rc != 0))
@@ -396,8 +392,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		    continue;
 
 		  newp = (struct gaih_servtuple *)
-		    alloca_account (sizeof (struct gaih_servtuple),
-				    alloca_used);
+		    alloca (sizeof (struct gaih_servtuple));
 
 		  if (gaih_inet_serv (service->name,
 				      tp, req, newp, tmpbuf) != 0)
@@ -422,7 +417,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 
       if (req->ai_socktype || req->ai_protocol)
 	{
-	  st = alloca_account (sizeof (struct gaih_servtuple), alloca_used);
+	  st = alloca (sizeof (struct gaih_servtuple));
 	  st->next = NULL;
 	  st->socktype = tp->socktype;
 	  st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY)
@@ -439,8 +434,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	      {
 		struct gaih_servtuple *newp;
 
-		newp = alloca_account (sizeof (struct gaih_servtuple),
-				       alloca_used);
+		newp = alloca (sizeof (struct gaih_servtuple));
 		newp->next = NULL;
 		newp->socktype = tp->socktype;
 		newp->protocol = tp->protocol;
@@ -459,7 +453,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 
   if (name != NULL)
     {
-      at = alloca_account (sizeof (struct gaih_addrtuple), alloca_used);
+      at = alloca (sizeof (struct gaih_addrtuple));
       at->family = AF_UNSPEC;
       at->scopeid = 0;
       at->next = NULL;
@@ -940,7 +934,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
   else
     {
       struct gaih_addrtuple *atr;
-      atr = at = alloca_account (sizeof (struct gaih_addrtuple), alloca_used);
+      atr = at = alloca (sizeof (struct gaih_addrtuple));
       memset (at, '\0', sizeof (struct gaih_addrtuple));
 
       if (req->ai_family == AF_UNSPEC)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [glibc/azanella/clang] posix: Remove alloca_account usage on getaddrinfo
@ 2022-03-10 19:21 Adhemerval Zanella
  0 siblings, 0 replies; 4+ messages in thread
From: Adhemerval Zanella @ 2022-03-10 19:21 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=82ad7fed52ec30b7b39d31d19fdf4b979c20e52f

commit 82ad7fed52ec30b7b39d31d19fdf4b979c20e52f
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 9 18:31:30 2022 -0300

    posix: Remove alloca_account usage on getaddrinfo

Diff:
---
 sysdeps/posix/getaddrinfo.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 13372e8d47..f22c36a262 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -336,10 +336,6 @@ gaih_inet (const char *name, const struct gaih_service *service,
   const char *canon = NULL;
   const char *orig_name = name;
 
-  /* Reserve stack memory for the scratch buffer in the getaddrinfo
-     function.  */
-  size_t alloca_used = sizeof (struct scratch_buffer);
-
   if (req->ai_protocol || req->ai_socktype)
     {
       ++tp;
@@ -371,7 +367,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	  if (tp->name[0])
 	    {
 	      st = (struct gaih_servtuple *)
-		alloca_account (sizeof (struct gaih_servtuple), alloca_used);
+		alloca (sizeof (struct gaih_servtuple));
 
 	      int rc = gaih_inet_serv (service->name, tp, req, st, tmpbuf);
 	      if (__glibc_unlikely (rc != 0))
@@ -396,8 +392,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		    continue;
 
 		  newp = (struct gaih_servtuple *)
-		    alloca_account (sizeof (struct gaih_servtuple),
-				    alloca_used);
+		    alloca (sizeof (struct gaih_servtuple));
 
 		  if (gaih_inet_serv (service->name,
 				      tp, req, newp, tmpbuf) != 0)
@@ -422,7 +417,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 
       if (req->ai_socktype || req->ai_protocol)
 	{
-	  st = alloca_account (sizeof (struct gaih_servtuple), alloca_used);
+	  st = alloca (sizeof (struct gaih_servtuple));
 	  st->next = NULL;
 	  st->socktype = tp->socktype;
 	  st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY)
@@ -439,8 +434,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	      {
 		struct gaih_servtuple *newp;
 
-		newp = alloca_account (sizeof (struct gaih_servtuple),
-				       alloca_used);
+		newp = alloca (sizeof (struct gaih_servtuple));
 		newp->next = NULL;
 		newp->socktype = tp->socktype;
 		newp->protocol = tp->protocol;
@@ -459,7 +453,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 
   if (name != NULL)
     {
-      at = alloca_account (sizeof (struct gaih_addrtuple), alloca_used);
+      at = alloca (sizeof (struct gaih_addrtuple));
       at->family = AF_UNSPEC;
       at->scopeid = 0;
       at->next = NULL;
@@ -940,7 +934,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
   else
     {
       struct gaih_addrtuple *atr;
-      atr = at = alloca_account (sizeof (struct gaih_addrtuple), alloca_used);
+      atr = at = alloca (sizeof (struct gaih_addrtuple));
       memset (at, '\0', sizeof (struct gaih_addrtuple));
 
       if (req->ai_family == AF_UNSPEC)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-16 18:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16 18:00 [glibc/azanella/clang] posix: Remove alloca_account usage on getaddrinfo Adhemerval Zanella
  -- strict thread matches above, loose matches on Subject: below --
2022-03-15 18:38 Adhemerval Zanella
2022-03-11 17:22 Adhemerval Zanella
2022-03-10 19:21 Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).