Skip to content

Commit

Permalink
Fix release compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jief committed Nov 8, 2023
1 parent 42cece9 commit 652c25f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 1 addition & 7 deletions rEFIt_UEFI/libeg/nanosvg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,7 @@ void nsvg__outputDanglingPtr()
}
}
#else
// When tracing allocation is not wanted (release version for exemple), we use macro. This way, the msg parameter is not compiled or evaluated.
// It prevents all the literal do be compiled and stored in the produced file.
#define nsvg__alloc(size, msg) AllocatePool(size)
#define nsvg__alloczero(size, msg) AllocateZeroPool(size)
#define nsvg__alloccopy(size, ref, msg) AllocateCopyPool(size, ref)
#define nsvg__realloc(oldsize, newsize, ref, msg) ReallocatePool(oldsize, newsize, ref)
#define nsvg__delete(buffer, msg) FreePool(buffer)
// Macros defined in header.
#endif


Expand Down
8 changes: 8 additions & 0 deletions rEFIt_UEFI/libeg/nanosvg.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,14 @@ void* nsvg__realloc(UINTN oldsize, UINTN newsize, void* ref, const XString8& msg
void nsvg__delete(void* buffer, const XString8& msg);
size_t nsvg__nbDanglingPtr();
void nsvg__outputDanglingPtr();
#else
// When tracing allocation is not wanted (release version for exemple), we use macro. This way, the msg parameter is not compiled or evaluated.
// It prevents all the literal do be compiled and stored in the produced file.
#define nsvg__alloc(size, msg) AllocatePool(size)
#define nsvg__alloczero(size, msg) AllocateZeroPool(size)
#define nsvg__alloccopy(size, ref, msg) AllocateCopyPool(size, ref)
#define nsvg__realloc(oldsize, newsize, ref, msg) ReallocatePool(oldsize, newsize, ref)
#define nsvg__delete(buffer, msg) FreePool(buffer)
#endif

bool isShapeInGroup(NSVGshape* shape, const char* groupName);
Expand Down
4 changes: 2 additions & 2 deletions rEFIt_UEFI/libeg/nanosvgrast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static void nsvg__resetPool(NSVGrasterizer* r)
r->curpage = r->pages;
}

static UINT8* nsvg__alloc(NSVGrasterizer* r, int size)
static UINT8* nsvgrast__alloc(NSVGrasterizer* r, int size)
{
UINT8* buf;
if (size > NSVG__MEMPAGE_SIZE) return NULL;
Expand Down Expand Up @@ -989,7 +989,7 @@ static NSVGactiveEdge* nsvg__addActive(NSVGrasterizer* r, NSVGedge* e, float sta
r->freelist = z->next;
} else {
// Alloc new edge.
z = (NSVGactiveEdge*)nsvg__alloc(r, sizeof(NSVGactiveEdge));
z = (NSVGactiveEdge*)nsvgrast__alloc(r, sizeof(NSVGactiveEdge));
if (z == NULL) return NULL;
}

Expand Down

0 comments on commit 652c25f

Please sign in to comment.