Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add aligned_alloc instead of memalign. #1404

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ endif
EE_CFLAGS += -fsingle-precision-constant -DOPL_VERSION=\"$(OPL_VERSION)\"

# There are a few places where the config key/value are truncated, so disable these warnings
EE_CFLAGS += -Wno-format-truncation -Wno-stringop-truncation
EE_CFLAGS += -Wno-format-truncation -Wno-stringop-truncation -std=gnu11
# Generate .d files to track header file dependencies of each object file
EE_CFLAGS += -MMD -MP
EE_OBJS += $(FRONTEND_OBJS) $(GFX_OBJS) $(AUDIO_OBJS) $(MISC_OBJS) $(EECORE_OBJS) $(IOP_OBJS)
Expand Down
2 changes: 1 addition & 1 deletion src/atlas.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ atlas_t *atlasNew(size_t width, size_t height, u8 psm)

size_t txtsize = gsKit_texture_size(width, height, psm);
atlas->surface.PSM = psm;
atlas->surface.Mem = (u32 *)memalign(128, txtsize);
atlas->surface.Mem = (u32 *)aligned_alloc(128, txtsize);
atlas->surface.Vram = 0;

// defaults to no clut
Expand Down
2 changes: 1 addition & 1 deletion src/opl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@ static void compatUpdate(item_list_t *support, unsigned char mode, config_set_t
result = 0;
LOG("CompatUpdate: updating for: device %d game %d\n", device, configSet == NULL ? -1 : id);

if ((HttpBuffer = memalign(64, HTTP_IOBUF_SIZE)) != NULL) {
if ((HttpBuffer = aligned_alloc(64, HTTP_IOBUF_SIZE)) != NULL) {
count = configSet != NULL ? 1 : support->itemGetCount(support);

if (count > 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void *readFile(char *path, int align, int *size)
}

if (align > 0)
buffer = memalign(64, realSize); // The allocation is aligned to aid the DMA transfers
buffer = aligned_alloc(64, realSize); // The allocation is aligned to aid the DMA transfers
else
buffer = malloc(realSize);

Expand Down