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