This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Move alloca outside of loop.


2001-05-16  Michael Snyder  <msnyder@redhat.com>

        * infcmd.c (do_registers_info): Move alloca outside of loop.

Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.27
diff -c -3 -p -r1.27 infcmd.c
*** infcmd.c    2001/05/04 04:15:25     1.27
--- infcmd.c    2001/05/16 17:59:26
*************** do_registers_info (int regnum, int fpreg
*** 1467,1478 ****
  {
    register int i;
    int numregs = NUM_REGS + NUM_PSEUDO_REGS;
  
    for (i = 0; i < numregs; i++)
      {
-       char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
-       char *virtual_buffer = (char*) alloca (MAX_REGISTER_VIRTUAL_SIZE);
- 
        /* Decide between printing all regs, nonfloat regs, or specific reg.  */
        if (regnum == -1)
        {
--- 1467,1477 ----
  {
    register int i;
    int numregs = NUM_REGS + NUM_PSEUDO_REGS;
+   char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+   char *virtual_buffer = (char*) alloca (MAX_REGISTER_VIRTUAL_SIZE);
  
    for (i = 0; i < numregs; i++)
      {
        /* Decide between printing all regs, nonfloat regs, or specific reg.  */
        if (regnum == -1)
        {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]