Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "plugin.h"
- void *util_alloc(size_t sz)
- {
- static size_t bytes_left;
- static void *plugin_buffer = NULL;
- if(!plugin_buffer)
- plugin_buffer = rb->plugin_get_buffer(&bytes_left);
- void *ret = plugin_buffer;
- plugin_buffer += sz;
- if((signed long) bytes_left - (signed long) sz < 0)
- {
- return NULL;
- }
- bytes_left -= sz;
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement