Skip to content

Instantly share code, notes, and snippets.

@rikaardhosein
Created April 22, 2012 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rikaardhosein/2466997 to your computer and use it in GitHub Desktop.
Save rikaardhosein/2466997 to your computer and use it in GitHub Desktop.
av_malloc_p2
#if CONFIG_MEMALIGN_HACK
ptr = malloc(size+ALIGN);
if(!ptr)
return ptr;
diff= ((-(long)ptr - 1)&(ALIGN-1)) + 1;
ptr = (char*)ptr + diff;
((char*)ptr)[-1]= diff;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment