Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
Vim
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Someone-Else
Vim
Commits
904c622b
Commit
904c622b
authored
14 years ago
by
Bram Moolenaar
Browse files
Options
Downloads
Patches
Plain Diff
Fix: errors for allocating zero bytes when profiling an empty function.
parent
5dff57d7
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/eval.c
+7
-4
7 additions, 4 deletions
src/eval.c
with
7 additions
and
4 deletions
src/eval.c
+
7
−
4
View file @
904c622b
...
...
@@ -21176,18 +21176,21 @@ builtin_function(name)
func_do_profile(fp)
ufunc_T *fp;
{
int len = fp->uf_lines.ga_len;
if (len == 0)
len = 1; /* avoid getting error for allocating zero bytes */
fp->uf_tm_count = 0;
profile_zero(&fp->uf_tm_self);
profile_zero(&fp->uf_tm_total);
if (fp->uf_tml_count == NULL)
fp->uf_tml_count = (int *)alloc_clear((unsigned)
(sizeof(int) * fp->uf_lines.ga_len));
fp->uf_tml_count = (int *)alloc_clear((unsigned) (sizeof(int) * len));
if (fp->uf_tml_total == NULL)
fp->uf_tml_total = (proftime_T *)alloc_clear((unsigned)
(sizeof(proftime_T) *
fp->uf_lines.ga_
len));
(sizeof(proftime_T) * len));
if (fp->uf_tml_self == NULL)
fp->uf_tml_self = (proftime_T *)alloc_clear((unsigned)
(sizeof(proftime_T) *
fp->uf_lines.ga_
len));
(sizeof(proftime_T) * len));
fp->uf_tml_idx = -1;
if (fp->uf_tml_count == NULL || fp->uf_tml_total == NULL
|| fp->uf_tml_self == NULL)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment