Convert everything from the talloc API to the ralloc API.
This commit is contained in:
@@ -54,7 +54,7 @@ load_text_fd (void *ctx, int fd)
|
||||
while (1) {
|
||||
if (total_read + CHUNK + 1 > text_size) {
|
||||
text_size = text_size ? text_size * 2 : CHUNK + 1;
|
||||
text = talloc_realloc_size (ctx, text, text_size);
|
||||
text = reralloc_size (ctx, text, text_size);
|
||||
if (text == NULL) {
|
||||
fprintf (stderr, "Out of memory\n");
|
||||
return NULL;
|
||||
@@ -64,7 +64,7 @@ load_text_fd (void *ctx, int fd)
|
||||
if (bytes < 0) {
|
||||
fprintf (stderr, "Error while reading: %s\n",
|
||||
strerror (errno));
|
||||
talloc_free (text);
|
||||
ralloc_free (text);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -107,8 +107,8 @@ int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
char *filename = NULL;
|
||||
void *ctx = talloc(NULL, void*);
|
||||
char *info_log = talloc_strdup(ctx, "");
|
||||
void *ctx = ralloc(NULL, void*);
|
||||
char *info_log = ralloc_strdup(ctx, "");
|
||||
const char *shader;
|
||||
int ret;
|
||||
|
||||
@@ -125,7 +125,7 @@ main (int argc, char *argv[])
|
||||
printf("%s", shader);
|
||||
fprintf(stderr, "%s", info_log);
|
||||
|
||||
talloc_free(ctx);
|
||||
ralloc_free(ctx);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user