Branch: Tag:

2016-12-31

2016-12-31 17:12:23 by Arne Goedeke <el@laramies.com>

Replace dynamic_buffer API everywhere

This change should be purely cosmetic. It replaces the old
dynamic_buffer API by the corresponding byte_buffer API everywhere.
The wrapper definitions in dynamic_buffer.h will remain for now.

6:      #include "global.h"   #include "stralloc.h" - #include "dynamic_buffer.h" + #include "buffer.h"   #include "program.h"   #include "las.h"   #include "docode.h"
53:   static int asm_opt(void);      /* Output buffer. The optimization eye is at the end of the buffer. */ - dynamic_buffer instrbuf; + struct byte_buffer instrbuf;   long num_instrs = 0;      
80:   #endif    }    -  toss_buffer(&instrbuf); +  buffer_free(&instrbuf);   }      /* insert_opcode{,0,1,2}() append an opcode to the instrbuf. */
88:   ptrdiff_t insert_opcode(p_instr *opcode)   {    /* Note: Steals references from opcode. */ -  p_instr *p = (p_instr *)low_make_buf_space(sizeof(p_instr), &instrbuf); +  p_instr *p = (p_instr *)buffer_alloc(&instrbuf, sizeof(p_instr));    if (!p) Pike_fatal("Out of memory in peep.\n");    *p = *opcode;    num_instrs++;
108:    Pike_fatal("hasarg2(%d) is wrong!\n",f);   #endif    -  p=(p_instr *)low_make_buf_space(sizeof(p_instr), &instrbuf); +  p=(p_instr *)buffer_alloc(&instrbuf, sizeof(p_instr));         #ifdef PIKE_DEBUG
958:    "pop_n_opcodes"));    }    num_instrs -= n; -  low_make_buf_space(-((INT32)sizeof(p_instr))*n, &instrbuf); +  buffer_remove(&instrbuf, sizeof(p_instr)*n);   }