diff options
author | Damien Doligez <damien.doligez-inria.fr> | 1997-05-26 17:16:31 +0000 |
---|---|---|
committer | Damien Doligez <damien.doligez-inria.fr> | 1997-05-26 17:16:31 +0000 |
commit | 8555ce8fe79fbf54924845a608054306733eeeba (patch) | |
tree | dd5b22190a08dcf3c1d8c16adc89988b60d982f1 /otherlibs/win32unix/unixsupport.c | |
parent | ff13e60cd68933428c60c10680c82c3cd91ea8c2 (diff) |
Changement de Push/Pop_roots en Begin/End_roots
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1572 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/win32unix/unixsupport.c')
-rw-r--r-- | otherlibs/win32unix/unixsupport.c | 51 |
1 files changed, 18 insertions, 33 deletions
diff --git a/otherlibs/win32unix/unixsupport.c b/otherlibs/win32unix/unixsupport.c index 029301454..b5aad5700 100644 --- a/otherlibs/win32unix/unixsupport.c +++ b/otherlibs/win32unix/unixsupport.c @@ -85,26 +85,24 @@ void unix_error(errcode, cmdname, cmdarg) value cmdarg; { value res; - Push_roots(r, 2); -#define name r[0] -#define arg r[1] - if (unix_error_exn == NULL) { - unix_error_exn = caml_named_value("Unix.Unix_error"); - if (unix_error_exn == NULL) - invalid_argument("Exception Unix.Unix_error not initialized, must link unix.cma"); - } - arg = cmdarg == Nothing ? copy_string("") : cmdarg; - name = copy_string(cmdname); - res = alloc(4, 0); - Field(res, 0) = *unix_error_exn; - Field(res, 1) = - cst_to_constr(errcode, error_table, sizeof(error_table)/sizeof(int), - sizeof(error_table)/sizeof(int)); - Field(res, 2) = name; - Field(res, 3) = arg; - Pop_roots(); -#undef name -#undef arg + value name = Val_unit, arg = Val_unit; + + Begin_roots2 (name, arg); + if (unix_error_exn == NULL) { + unix_error_exn = caml_named_value("Unix.Unix_error"); + if (unix_error_exn == NULL) + invalid_argument("Exception Unix.Unix_error not initialized, must link unix.cma"); + } + arg = cmdarg == Nothing ? copy_string("") : cmdarg; + name = copy_string(cmdname); + res = alloc(4, 0); + Field(res, 0) = *unix_error_exn; + Field(res, 1) = + cst_to_constr(errcode, error_table, sizeof(error_table)/sizeof(int), + sizeof(error_table)/sizeof(int)); + Field(res, 2) = name; + Field(res, 3) = arg; + End_roots(); mlraise(res); } @@ -114,16 +112,3 @@ void uerror(cmdname, cmdarg) { unix_error(errno, cmdname, cmdarg); } - -value unix_freeze_buffer(buf) - value buf; -{ - if (Is_young(buf)) { - Push_roots(r, 1); - r[0] = buf; - minor_collection(); - buf = r[0]; - Pop_roots(); - } - return buf; -} |