diff options
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 40 |
1 files changed, 16 insertions, 24 deletions
@@ -307,20 +307,16 @@ read_allocator (App *app, int fd, guint time) if (! readn (fd, &A->n_frames, sizeof (A->n_frames))) return NULL; - A->ips = client_perm_alloc (&app->client, - sizeof (gulong) * A->n_frames + - sizeof (const gchar *) * 2 * A->n_frames); - A->functions = (const gchar **) (A->ips + A->n_frames); - A->functions_srcloc = A->functions + A->n_frames; + A->frames = client_perm_alloc (&app->client, + sizeof (Frame *) * A->n_frames); - if (! readn (fd, A->ips, A->n_frames * sizeof (gulong))) + if (! readn (fd, A->frames, A->n_frames * sizeof (gulong))) return NULL; for (n = 0; n < A->n_frames; n++) { - Frame *frame = frames_get (&app->client.frames, A->ips[n]); - g_return_val_if_fail (frame != NULL, NULL); - A->functions[n] = frame->function; - A->functions_srcloc[n] = frame->function_srcloc; + A->frames[n] = frames_get (&app->client.frames, + ((gulong *) A->frames)[n]); + g_return_val_if_fail (A->frames[n] != NULL, NULL); } A->alloc_fn_serial = 0; @@ -622,11 +618,11 @@ _client_update_alloc_fn (Client *client) break; for (n = 0; n < A->n_frames - 1; n++) { - if (! frames_is_alloc_fn (&client->frames, A->ips[n])) + if (! frames_is_alloc_fn (&client->frames, A->frames[n])) break; } - A->alloc_fn = A->functions[n]; + A->alloc_fn = A->frames[n]->function; A->alloc_fn_serial = serial; } } @@ -1581,20 +1577,16 @@ lwp_read (GIOChannel *io, App *app) if (! readn (fd, &A->n_frames, sizeof (A->n_frames))) return FALSE; - A->ips = client_perm_alloc (&app->client, - sizeof (gulong) * A->n_frames + - sizeof (const gchar *) * 2 * A->n_frames); - A->functions = (const gchar **) (A->ips + A->n_frames); - A->functions_srcloc = A->functions + A->n_frames; + A->frames = client_perm_alloc (&app->client, + sizeof (Frame *) * A->n_frames); - if (! readn (fd, A->ips, A->n_frames * sizeof (gulong))) + if (! readn (fd, A->frames, A->n_frames * sizeof (gulong))) return FALSE; for (n = 0; n < A->n_frames; n++) { - Frame *frame = frames_get (&app->client.frames, A->ips[n]); - g_return_val_if_fail (frame != NULL, FALSE); - A->functions[n] = frame->function; - A->functions_srcloc[n] = frame->function_srcloc; + A->frames[n] = frames_get (&app->client.frames, + ((gulong *)A->frames)[n]); + g_return_val_if_fail (A->frames[n] != NULL, FALSE); } A->alloc_fn_serial = 0; @@ -1838,9 +1830,9 @@ vg_log_server_cb (GIOChannel *source, } gboolean -app_is_alloc_fn (App *app, gulong ip) +app_is_alloc_fn (App *app, Frame *f) { - return frames_is_alloc_fn (&app->client.frames, ip); + return frames_is_alloc_fn (&app->client.frames, f); } gboolean |