};
/* A o65 relocation table */
-#define RELOC_BLOCKSIZE 4096
typedef struct O65RelocTab O65RelocTab;
struct O65RelocTab {
unsigned Size; /* Size of the table */
/* Do we have enough space in the buffer? */
if (R->Fill == R->Size) {
/* We need to grow the buffer */
- unsigned char* NewBuf = xmalloc (R->Size + RELOC_BLOCKSIZE);
+ unsigned NewSize = (R->Size == 0)? 1024 : R->Size * 2;
+ unsigned char* NewBuf = xmalloc (NewSize);
memcpy (NewBuf, R->Buf, R->Size);
xfree (R->Buf);
- R->Buf = NewBuf;
+ R->Size = NewSize;
+ R->Buf = NewBuf;
}
/* Put the byte into the buffer */