mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Use std::deque for section patches
This commit is contained in:
@@ -2,8 +2,10 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <assert.h>
|
||||
#include <deque>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <new>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
@@ -283,7 +285,9 @@ static struct Section *createSection(char const *name, enum SectionType type,
|
||||
sect->bank = bank;
|
||||
sect->align = alignment;
|
||||
sect->alignOfs = alignOffset;
|
||||
sect->patches = NULL;
|
||||
sect->patches = new(std::nothrow) std::deque<struct Patch *>();
|
||||
if (sect->patches == NULL)
|
||||
fatalerror("Not enough memory for section patches: %s\n", strerror(errno));
|
||||
|
||||
// It is only needed to allocate memory for ROM sections.
|
||||
if (sect_HasData(type)) {
|
||||
|
||||
Reference in New Issue
Block a user