mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Merge pull request #417 from ISSOtm/zero_sections
Allow 0-byte SECTIONs to be fixed anywhere
This commit is contained in:
@@ -155,6 +155,11 @@ int32_t area_Avail(int32_t bank)
|
|||||||
|
|
||||||
int32_t area_doAlloc(struct sFreeArea *pArea, int32_t org, int32_t size)
|
int32_t area_doAlloc(struct sFreeArea *pArea, int32_t org, int32_t size)
|
||||||
{
|
{
|
||||||
|
if (size == 0) {
|
||||||
|
/* 0-byte SECTIONs don't take any room, they can go anywhere */
|
||||||
|
return org;
|
||||||
|
}
|
||||||
|
|
||||||
if ((org >= pArea->nOrg)
|
if ((org >= pArea->nOrg)
|
||||||
&& ((org + size) <= (pArea->nOrg + pArea->nSize))) {
|
&& ((org + size) <= (pArea->nOrg + pArea->nSize))) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user