Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion c_src/driver_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ char *read_string(char **data) {
void *ejs_alloc(ErlDrvSizeT size) {
void *p = driver_alloc(size);
if (p == NULL) {
erl_exit(1, "erlang_js: Can't allocate %lu bytes of memory\n", size);
erts_exit(1, "erlang_js: Can't allocate %lu bytes of memory\n", size);
}
return p;
}
2 changes: 1 addition & 1 deletion c_src/driver_comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ char *read_string(char **data);

/* Wrapper around driver_alloc() that checks */
/* for OOM. */
void erl_exit(int n, char*, ...);
void erts_exit(int n, char*, ...);
void *ejs_alloc(ErlDrvSizeT size);

#endif
5 changes: 2 additions & 3 deletions src/js_benchmark.erl
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ run() ->
%% @private
time_calls(Ctx, Count) ->
io:format("Starting: ~p~n", [Count]),
Start = erlang:now(),
do_calls(Ctx, Count),
timer:now_diff(erlang:now(), Start) / Count.
{Elapsed, _} = timer:tc(fun do_calls/2, [Ctx, Count]),
Elapsed / Count.

%% @private
do_calls(_Ctx, 0) ->
Expand Down