Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Conversation

@EraYaN
Copy link

@EraYaN EraYaN commented Dec 28, 2015

Added inline redefine.
Fixed conflict with winioctl.h

It does not pass the last test though on Windows (in the encoder). I only need the decoder though.

Added inline redefine.
Fixed conflict with winioctl.h
// Build cookie buffer.
uint32_t cookieSize = e->enc_.GetMagicCookieSize(e->outf_.mChannelsPerFrame);
char cookie[cookieSize];
char* cookie = (char*)alloca(sizeof(char) * (cookieSize));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You never free this, it will leak memory...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alloca shouldn't need to be freed. Read the docs.

Copy link

@LinusU LinusU May 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're absolutely correct, nevermind :)

Copy link

@m-a-v m-a-v May 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I solved the same problems (building for a VS version < VS2013).

I would prefer a ifndef since for gcc it doesn't seem to be a problem.

See my changes here:
https://github.com/m-a-v/node-libalac/commits/master

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code should have the same effect on gcc, the alloca statement is just more specific. One would need to check if it truly gives the same code path, but I feel preprocessor directives are an "ugly" hack and should be minimized. I already hated the fact I needed to add one for __inline.

@LinusU
Copy link

LinusU commented May 9, 2016

@EraYaN Shouldn't this be added to the ALAC-patches folder though?

@EraYaN
Copy link
Author

EraYaN commented May 9, 2016

I find the ARMEL patch that is in the patch folder unnecessary as well. No compiler will break if you add it into the normal code. So no?

@LinusU
Copy link

LinusU commented May 9, 2016

I think that it's just to document what changes have been added on top of the official Apple release, I might be wrong though...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants